Как сделать крафт bukkit

Обновлено: 02.07.2024

пытаюсь написать плагин для сервера на свои крафты, столкнулся с такой проблемой, тк в 1.12 добавили книгу рецептов, то код для создания своего крафта тоже изменили, как можно было раньше
private void craft() < // выдает ошибку The method craft() from the type NeWea is never used locally
ItemStack item = new ItemStack(Material.IRON_SWORD);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(ChatColor.RED + "MURAMASA");
List<String> lore = new ArrayList<String>();
lore.add("Лезвие впитывает в себя всю кровь врагов");
meta.setLore(lore);
meta.addEnchant(Enchantment.DAMAGE_ALL, 6, true);
item.setItemMeta(meta);
ShapedRecipe m = new ShapedRecipe(item); // выдает ошибку The constructor ShapedRecipe(ItemStack) is deprecated
m.shape(new String[] );
m.setIngredient('I', Material.IRON_INGOT);
m.setIngredient('V', Material.LAVA_BUCKET);
m.setIngredient('S', Material.IRON_SWORD);
m.setIngredient('D', Material.DIAMOND);
Bukkit.getServer().addRecipe(m);
искал в гугле, там есть очень мало инфы про это, кто нить можете разжевать по подробнее

Morttal

1. Тему перенесли в оффтоп, ибо то раздел моддинга.
2. Для нормальной подачи темы, для кода есть специальная вставка. "Вставить - Код"
3. Посмотри исходник другого плагина либо ищи на форумах по плагинам.

[1.9-1.16] Custom Recipes and Crafting (CraftEnhance)

More detailed info is written in the github wiki, so make sure to check that out too.

And also, Donations are really appreciated! I've put alot of my spare time into developing this opensource plugin. So maybe consider buying me a nice cup of coffee! :)


CraftEnhance is the first plugin that allows crafting with all custom items. It's very unique. Try and see how awesome it is! It's compatible with basically every bukkit or spigot version.

featuresBanner

Create recipes with all custom items

This means you can add recipes with enchantments, custom names, a durability, potions or anything you can think of that exists in the game.

Full GUI support.

Editing recipes, creating recipes, viewing recipes and ordering the recipes in the viewer GUI are all possible through inventory GUIs.

Middle click to edit.

Opening the editor for a recipe is not done through a command, but done through a simple middlemouseclick on a recipe in the recipe viewer. This does require a permission.

Set permissions for a recipe.

In order to completely let server owners be owners of their server, permissions for the custom recipes exist. People that don't have the permission for a custom recipe, can't craft or see it. The 'seeing' part can be configured.

Edit items in-game.

To make cool recipes an item editor is needed. This item editor allows users to set colored lore, set colored names, set the durability, add enchantments, add itemflags or even set the localizedname of items. And for the record: itemflags are the things that allow you to hide enchantments or attributes on items!

Full tab completion support!

I personally think this is an obligated feature to have in the 1.13 update of Minecraft. No more remembering all commands, just the first few letters of a few basic ones.

Creating recipes is easy and done through GUI's. Here's a quick video where everything is explained.

Making the custom items for your precious recipes is also really easy to do as explained in this video.

SoulStriker has also kindly made a showcase for this plugin:

Установка [ ]

Windows [ ]

  1. Скачиваем сервер, пусть данный пример будет на версии 1.12;
  2. Перемещаем jar-архив в папку для сервера
  3. Открываем блокнот или другой текстовый редактор
  4. Вписываем туда, подставив название скачанного jar файла. Например для версии 1.12 текст в блокноте будет выглядеть так:

или (для 64-битной Java)

или (для 32-битной Java)

  • Для 32-битной системы или 64-битной системы и 64-битной версии Java пишем это:
  • Для 64-битной системы и 32-битной версии Java пишем это:

Или создаём в любом месте скрипт для упрощения запуска:

  • Для 32-битной системы или 64-битной системы и 64-битной версии Java:
  • Для 64-битной системы и 32-битной версии Java:
  • Если не помогло, есть вариант:
  • Также, есть пользовательский скрипт:

Данный скрипт перезапускает сервер, если пользователь нажал на клавишу, а не закрыл консоль.

Linux [ ]

  1. Скачиваем сервер
  2. Перемещаем jar-архив в папку для сервера
  3. Сервер готов, для запуска переходим в папку сервера и отдаем команду java -Xincgc -Xmx1G -jar craftbukkit-<версия>.jar .

Желательно изменить опцию «-Xmx1G» в соответствии с количеством свободной оперативной памяти. Объём памяти должен быть больше 1 гигабайта, то есть не «-Xmx2G» или «-Xmx5600M»

При желании можно повесить эту команду на кнопку на панели или в меню:


Или создать в любом месте скрипт для упрощения запуска:

Скрипт нужно сделать исполняемым: chmod a+x start.sh и можно запускать командой sh start.sh .


Или даже прописать алиас, добавив где-нибудь в

После этого сервер можно будет запускать командой mcserver .


Возможно, Вы также захотите использовать init-скрипт для фоновой работы сервера.

These are all the command you need when using this plugin. If something is between [these brackets], it means it's an optional part of the command. If something is between (these backets) it's not optional.

/ceh

Just use autocompletion on this command! Oh and by the way, it's short for C raft E n H ance.

/recipes

View the available custom recipes in a GUI. You can also use the /ceh viewer command if you're really feeling like typing this longer command.

/ceh createrecipe Как сделать крафт bukkit

Create a new custom recipe with a generated key by default. This will open a recipe editor GUI. You can leave the perms empty, but if you wanna set a permission, you also gotta set a key!

/ceh reload

/ceh specs (key)

Shows the specifications of the recipe with the specified key. You can find the key of a recipe by middle clicking it in the recipe viewer to open the editor for it where the key is displayed.

/ceh setpermission (key) (permission)

Set the permission of the recipe with the specified key to the specified permission. Again, you can find the key of a recipe in the editor.

/ceh changekey (oldkey) (newkey)

Simply changes the key of a recipe to "newkey"!

/ceh cleanitemfile

Cleans the items.yml file meaning that it'll remove all saved unused items from the file. I wouldn't recommend to use this because it doesn't affect performance of your server much or at all.

/edititem

This is the basic command for editing items. Please use tab completion on this.

/edititem name [name]

Edit the name of the item in your main hand. Make sure that you use all the colors you want!

/edititem durability 78

Set the durability of the item in your main hand to 62% of it's max durability.

/edititem enchant [enchant] [lvl] [enchant] [lvl][..]

Set your specified enchantments to your held item. It removes all enchants and then adds the specified ones.

/edititem itemflag [itemflag] [itemflag] [..]

Toggle the specified itemflags on your held item. This are the available itemflags:

Setting to show/hide what the ItemStack can break/destroy Setting to show/hide where this ItemStack can be build/placed on Setting to show/hide potion effects on this ItemStack

/edititem lore [line_number] [lore]

Set the specified line of the lore of your held item to be the specified tekst. The tekst section can be left empty if an empty line needs to be added.

The permissions are configurable!

However, these are the default permissions. You can also look these up in the config.yml file.

craftenhance.edit

/ceh createrecipe, /ceh cleanitemfile, /ceh orderrecipes, /ceh setpermission, /ceh specs, /ceh changekey. This is also the permission required to middleclick recipes to open the editor.

Добавление своих рецептов,форменных,бесформенных,плавких

Что же такое форменный рецепт? От слова форменный сразу становится понятно что он имеет какую-то форму.Под формой подразумевается определенное место каждого предмета для крафта в верстаке.
На скриншоте ниже можно увидеть особое положение предметов установленное мной.

Скриншот 02-03-2019 104204.jpg

Но если мы поменяем один предмет местом,то крафт уже перестаёт работать.Вот в этом суть форменного рецепта.

Minecraft Wiki

Из-за новой политики Microsoft в отношении сторонних ресурсов, Minecraft Wiki больше не является официальной. В связи с этим были внесены некоторые изменения, в том числе и обновлён логотип вики-проекта. Подробности на нашем Discord-сервере.

Bukkit

2 января 2011 г. (Объявлен) 28 октября 2012 г.

37,5 МБ (CraftBukkit-1.12)

1.7.9 (1.7.10 в предварительных сборках)

В феврале 2012 года разработчики Bukkit официально влились в команду Mojang.

Позже команды разработчиков Spigot, Cauldron и Bukkit объединили усилия в новой универсальной серверной платформе

Управление [ ]

В управлении и настройке сервер Bukkit во многом схож с чистым сервером, необходимая информация по этому может быть найдена здесь.

Bukkit предоставляет все те же команды, что и оригинальный сервер Minecraft, но также имеет и три собственные особые команды:

Содержание

Читайте также: