• Chào bạn, hãy đăng ký hoặc đăng nhập để tham gia cùng bọn mình và sử dụng được đầy đủ chức năng của diễn đàn :).
sikskUnII

Hướng dẫn Code plugin new tool

sikskUnII

THÀNH VIÊN
Tham gia
26/01/2017
Bài viết
2,467
thêm các công thức chế bằng obsidian và emeral, khi craft bằng 2 món này thì dụng cụ khi craft sẽ có enchant sẵn
Mã:
package me.ThanhLong;

import java.io.PrintStream;
import org.bukkit.Material;
import org.bukkit.Server;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.plugin.java.JavaPlugin;

import net.minecraft.util.org.apache.commons.codec.binary.Hex;


@SuppressWarnings("unused")
public class Main
  extends JavaPlugin
{
  public void onEnable()
  {
    System.out.println("[ThanhLong] NewTool on");
  
    ItemStack rum3 = new ItemStack(Material.LEATHER_CHESTPLATE, 1);
    ItemMeta rum3M = rum3.getItemMeta();
    rum3M.setDisplayName("Obsidian Chestplate");
    rum3M.addEnchant(Enchantment.DURABILITY, 2, true);
    rum3M.addEnchant(Enchantment.PROTECTION_FIRE, 2, true);
    rum3.setItemMeta(rum3M);
    ShapedRecipe recette1 = new ShapedRecipe(rum3);
  
    recette1.shape(new String[] { "A A", "AAA", "AAA" });
    recette1.setIngredient('A', Material.OBSIDIAN);
  
    getServer().addRecipe(recette1);
  
    ItemStack rum2 = new ItemStack(Material.LEATHER_BOOTS, 1);
    ItemMeta rum2M = rum2.getItemMeta();
    rum2M.setDisplayName("Obsidian Boots");
    rum2M.addEnchant(Enchantment.DURABILITY, 2, true);
    rum2M.addEnchant(Enchantment.PROTECTION_FIRE, 2, true);
    rum2.setItemMeta(rum2M);
    ShapedRecipe recette2 = new ShapedRecipe(rum2);
  
    recette2.shape(new String[] { "   ", "A A", "A A" });
    recette2.setIngredient('A', Material.OBSIDIAN);
  
    getServer().addRecipe(recette2);
  
    ItemStack rum1 = new ItemStack(Material.LEATHER_LEGGINGS, 1);
    ItemMeta rum1M = rum1.getItemMeta();
    rum1M.setDisplayName("Obsidian Leggings");
    rum1M.addEnchant(Enchantment.DURABILITY, 2, true);
    rum1M.addEnchant(Enchantment.PROTECTION_FIRE, 2, true);
    rum1.setItemMeta(rum1M);
    ShapedRecipe recette3 = new ShapedRecipe(rum1);
  
    recette3.shape(new String[] { "AAA", "A A", "A A" });
    recette3.setIngredient('A', Material.OBSIDIAN);
  
    getServer().addRecipe(recette3);
  
    ItemStack rum = new ItemStack(Material.LEATHER_HELMET, 1);
    ItemMeta rumM = rum.getItemMeta();
    rumM.setDisplayName("Obsidian Helmet");
    rumM.addEnchant(Enchantment.DURABILITY, 2, true);
    rumM.addEnchant(Enchantment.PROTECTION_FIRE, 2, true);
    rum.setItemMeta(rumM);
    ShapedRecipe recette4 = new ShapedRecipe(rum);
  
    recette4.shape(new String[] { "AAA", "A A", "   " });
    recette4.setIngredient('A', Material.OBSIDIAN);
  
    getServer().addRecipe(recette4);
  
    ItemStack rum4 = new ItemStack(Material.LEATHER_CHESTPLATE, 1);
    ItemMeta rum4M = rum4.getItemMeta();
    rum4M.setDisplayName("Emerald Chestplate");
    rum4M.addEnchant(Enchantment.DURABILITY, 4, true);
    rum4M.addEnchant(Enchantment.PROTECTION_FIRE, 4, true);
    rum4.setItemMeta(rum4M);
    ShapedRecipe recette5 = new ShapedRecipe(rum4);
  
    recette5.shape(new String[] { "A A", "AAA", "AAA" });
    recette5.setIngredient('A', Material.EMERALD);
  
    getServer().addRecipe(recette5);
  
    ItemStack rum5 = new ItemStack(Material.LEATHER_BOOTS, 1);
    ItemMeta rum5M = rum5.getItemMeta();
    rum5M.setDisplayName("Emerald Boots");
    rum5M.addEnchant(Enchantment.DURABILITY, 4, true);
    rum5M.addEnchant(Enchantment.PROTECTION_FIRE, 4, true);
    rum5.setItemMeta(rum5M);
    ShapedRecipe recette6 = new ShapedRecipe(rum5);
  
    recette6.shape(new String[] { "   ", "A A", "A A" });
    recette6.setIngredient('A', Material.EMERALD);
  
    getServer().addRecipe(recette6);
  
    ItemStack rum6 = new ItemStack(Material.LEATHER_LEGGINGS, 1);
    ItemMeta rum6M = rum6.getItemMeta();
    rum6M.setDisplayName("Emeral Leggings");
    rum6M.addEnchant(Enchantment.DURABILITY, 4, true);
    rum6M.addEnchant(Enchantment.PROTECTION_FIRE, 4, true);
    rum6.setItemMeta(rum6M);
    ShapedRecipe recette7 = new ShapedRecipe(rum6);
  
    recette7.shape(new String[] { "AAA", "A A", "A A" });
    recette7.setIngredient('A', Material.EMERALD);
  
    getServer().addRecipe(recette7);
  
    ItemStack rum7 = new ItemStack(Material.LEATHER_HELMET, 1);
    ItemMeta rum7M = rum7.getItemMeta();
    rum7M.setDisplayName("Emerald Helmet");
    rum7M.addEnchant(Enchantment.DURABILITY, 4, true);
    rum7M.addEnchant(Enchantment.PROTECTION_FIRE, 4, true);
    rum7.setItemMeta(rum7M);
    ShapedRecipe recette8 = new ShapedRecipe(rum7);
  
    recette8.shape(new String[] { "AAA", "A A", "   " });
    recette8.setIngredient('A', Material.EMERALD);
  
    getServer().addRecipe(recette8);
  
    ItemStack rum8 = new ItemStack(Material.WOOD_AXE, 1);
    ItemMeta rum8M = rum8.getItemMeta();
    rum8M.setDisplayName("Obsidian Axe");
    rum8M.addEnchant(Enchantment.DURABILITY, 2, true);
    rum8M.addEnchant(Enchantment.PROTECTION_FIRE, 2, true);
    rum8M.addEnchant(Enchantment.DAMAGE_ALL, 3, true);
    rum8.setItemMeta(rum8M);
    ShapedRecipe recette9 = new ShapedRecipe(rum8);
  
    recette9.shape(new String[]{ "AA ", "AB ", " B "});
    recette9.setIngredient('A', Material.OBSIDIAN);
    recette9.setIngredient('B', Material.STICK);
  
    getServer().addRecipe(recette9);
  
    ItemStack rum9 = new ItemStack(Material.WOOD_AXE, 1);
    ItemMeta rum9M = rum9.getItemMeta();
    rum9M.setDisplayName("Obsidian Axe");
    rum9M.addEnchant(Enchantment.DURABILITY, 2, true);
    rum9M.addEnchant(Enchantment.PROTECTION_FIRE, 2, true);
    rum9M.addEnchant(Enchantment.DAMAGE_ALL, 3, true);
    rum9.setItemMeta(rum9M);
    ShapedRecipe recette10 = new ShapedRecipe(rum9);
  
    recette10.shape(new String[]{ " AA", " AB", "  B" });
    recette10.setIngredient('A', Material.OBSIDIAN);
    recette10.setIngredient('B', Material.STICK);
  
    getServer().addRecipe(recette10);
  
    ItemStack rum11 = new ItemStack(Material.LEATHER_HELMET, 1);
    ItemMeta rum11M = rum11.getItemMeta();
    rum11M.setDisplayName("Obsidian Helmet");
    rum11M.addEnchant(Enchantment.DURABILITY, 2, true);
    rum11M.addEnchant(Enchantment.PROTECTION_FIRE, 2, true);
    rum11.setItemMeta(rum11M);
    ShapedRecipe recette12 = new ShapedRecipe(rum11);
  
    recette12.shape(new String[] {"   " ,"AAA", "A A" });
    recette12.setIngredient('A', Material.OBSIDIAN);
  
    getServer().addRecipe(recette12);
  
    ItemStack rum12 = new ItemStack(Material.LEATHER_HELMET, 1);
    ItemMeta rum12M = rum12.getItemMeta();
    rum12M.setDisplayName("Obsidian Helmet");
    rum12M.addEnchant(Enchantment.DURABILITY, 4, true);
    rum12M.addEnchant(Enchantment.PROTECTION_FIRE, 4, true);
    rum12.setItemMeta(rum12M);
    ShapedRecipe recette13 = new ShapedRecipe(rum12);
  
    recette13.shape(new String[] {"   " ,"AAA", "A A" });
    recette13.setIngredient('A', Material.EMERALD);
  
    getServer().addRecipe(recette13);
  
    ItemStack rum13 = new ItemStack(Material.LEATHER_BOOTS, 1);
    ItemMeta rum13M = rum13.getItemMeta();
    rum13M.setDisplayName("Emerald Boots");
    rum13M.addEnchant(Enchantment.DURABILITY, 4, true);
    rum13M.addEnchant(Enchantment.PROTECTION_FIRE, 4, true);
    rum13.setItemMeta(rum13M);
    ShapedRecipe recette14 = new ShapedRecipe(rum13);
  
    recette14.shape(new String[] { "A A", "A A", "   " });
    recette14.setIngredient('A', Material.EMERALD);
  
    getServer().addRecipe(recette14);
  
    ItemStack rum14 = new ItemStack(Material.LEATHER_BOOTS, 1);
    ItemMeta rum14M = rum14.getItemMeta();
    rum14M.setDisplayName("Obsidian Boots");
    rum14M.addEnchant(Enchantment.DURABILITY, 2, true);
    rum14M.addEnchant(Enchantment.PROTECTION_FIRE, 2, true);
    rum14.setItemMeta(rum14M);
    ShapedRecipe recette15 = new ShapedRecipe(rum14);
  
    recette15.shape(new String[] { "A A", "A A", "   " });
    recette15.setIngredient('A', Material.OBSIDIAN);
  
    getServer().addRecipe(recette15);
  
    ItemStack rum16 = new ItemStack(Material.WOOD_AXE, 1);
    ItemMeta rum16M = rum16.getItemMeta();
    rum16M.setDisplayName("Emerald Axe");
    rum16M.addEnchant(Enchantment.DURABILITY, 4, true);
    rum16M.addEnchant(Enchantment.PROTECTION_FIRE, 4, true);
    rum16M.addEnchant(Enchantment.DAMAGE_ALL, 4, true);
    rum16.setItemMeta(rum16M);
    ShapedRecipe recette17 = new ShapedRecipe(rum16);
  
    recette17.shape(new String[]{ "AA ", "AB ", " B "});
    recette17.setIngredient('A', Material.EMERALD);
    recette17.setIngredient('B', Material.STICK);
  
    getServer().addRecipe(recette17);
  
    ItemStack rum17 = new ItemStack(Material.WOOD_AXE, 1);
    ItemMeta rum17M = rum17.getItemMeta();
    rum17M.setDisplayName("Emerald Axe");
    rum17M.addEnchant(Enchantment.DURABILITY, 4, true);
    rum17M.addEnchant(Enchantment.PROTECTION_FIRE, 4, true);
    rum17M.addEnchant(Enchantment.DAMAGE_ALL, 4, true);
    rum17.setItemMeta(rum17M);
    ShapedRecipe recette18 = new ShapedRecipe(rum17);
  
    recette18.shape(new String[]{ " AA", " AB", "  B" });
    recette18.setIngredient('A', Material.EMERALD);
    recette18.setIngredient('B', Material.STICK);
  
    getServer().addRecipe(recette18);
  
    ItemStack rum18 = new ItemStack(Material.WOOD_SWORD, 1);
    ItemMeta rum18M = rum18.getItemMeta();
    rum18M.setDisplayName("Emerald sword");
    rum18M.addEnchant(Enchantment.DURABILITY, 4, true);
    rum18M.addEnchant(Enchantment.PROTECTION_FIRE, 4, true);
    rum18M.addEnchant(Enchantment.DAMAGE_ALL, 6, true);
    rum18.setItemMeta(rum18M);
    ShapedRecipe recette19 = new ShapedRecipe(rum18);
  
    recette19.shape(new String[]{ " A ", " A ", " B " });
    recette19.setIngredient('A', Material.EMERALD);
    recette19.setIngredient('B', Material.STICK);
  
    getServer().addRecipe(recette19);
  
    ItemStack rum19 = new ItemStack(Material.WOOD_SWORD, 1);
    ItemMeta rum19M = rum19.getItemMeta();
    rum19M.setDisplayName("Emerald sword");
    rum19M.addEnchant(Enchantment.DURABILITY, 4, true);
    rum19M.addEnchant(Enchantment.PROTECTION_FIRE, 4, true);
    rum19M.addEnchant(Enchantment.DAMAGE_ALL, 6, true);
    rum19.setItemMeta(rum19M);
    ShapedRecipe recette20 = new ShapedRecipe(rum19);
  
    recette20.shape(new String[]{ "A  ", "A  ", "B  " });
    recette20.setIngredient('A', Material.EMERALD);
    recette20.setIngredient('B', Material.STICK);
  
    getServer().addRecipe(recette20);
  
    ItemStack rum20 = new ItemStack(Material.WOOD_SWORD, 1);
    ItemMeta rum20M = rum20.getItemMeta();
    rum20M.setDisplayName("Emerald sword");
    rum20M.addEnchant(Enchantment.DURABILITY, 4, true);
    rum20M.addEnchant(Enchantment.PROTECTION_FIRE, 4, true);
    rum20M.addEnchant(Enchantment.DAMAGE_ALL, 6, true);
    rum20.setItemMeta(rum20M);
    ShapedRecipe recette21 = new ShapedRecipe(rum20);
  
    recette21.shape(new String[]{ "  A", "  A", "  B" });
    recette21.setIngredient('A', Material.EMERALD);
    recette21.setIngredient('B', Material.STICK);
  
    getServer().addRecipe(recette21);
  
    ItemStack rum21 = new ItemStack(Material.WOOD_SWORD, 1);
    ItemMeta rum21M = rum21.getItemMeta();
    rum21M.setDisplayName("Obsidian sword");
    rum21M.addEnchant(Enchantment.DURABILITY, 2, true);
    rum21M.addEnchant(Enchantment.PROTECTION_FIRE, 2, true);
    rum21M.addEnchant(Enchantment.DAMAGE_ALL, 4, true);
    rum21.setItemMeta(rum21M);
    ShapedRecipe recette22 = new ShapedRecipe(rum21);
  
    recette22.shape(new String[]{ " A ", " A ", " B " });
    recette22.setIngredient('A', Material.OBSIDIAN);
    recette22.setIngredient('B', Material.STICK);
  
    getServer().addRecipe(recette22);
  
    ItemStack rum22 = new ItemStack(Material.WOOD_SWORD, 1);
    ItemMeta rum22M = rum22.getItemMeta();
    rum22M.setDisplayName("Osidian sword");
    rum22M.addEnchant(Enchantment.DURABILITY, 2, true);
    rum22M.addEnchant(Enchantment.PROTECTION_FIRE, 2, true);
    rum22M.addEnchant(Enchantment.DAMAGE_ALL, 4, true);
    rum22.setItemMeta(rum22M);
    ShapedRecipe recette23 = new ShapedRecipe(rum22);
  
    recette23.shape(new String[]{ "A  ", "A  ", "B  " });
    recette23.setIngredient('A', Material.OBSIDIAN);
    recette23.setIngredient('B', Material.STICK);
  
    getServer().addRecipe(recette23);
  
    ItemStack rum23 = new ItemStack(Material.WOOD_SWORD, 1);
    ItemMeta rum23M = rum23.getItemMeta();
    rum23M.setDisplayName("Osidian sword");
    rum23M.addEnchant(Enchantment.DURABILITY, 2, true);
    rum23M.addEnchant(Enchantment.PROTECTION_FIRE, 2, true);
    rum23M.addEnchant(Enchantment.DAMAGE_ALL, 4, true);
    rum23.setItemMeta(rum23M);
    ShapedRecipe recette24 = new ShapedRecipe(rum23);
  
    recette24.shape(new String[]{ "  A", "  A", "  B" });
    recette24.setIngredient('A', Material.OBSIDIAN);
    recette24.setIngredient('B', Material.STICK);
  
    getServer().addRecipe(recette24);
  
    ItemStack rum24 = new ItemStack(Material.WOOD_SPADE, 1);
    ItemMeta rum24M = rum24.getItemMeta();
    rum24M.setDisplayName("Obsidian spade");
    rum24M.addEnchant(Enchantment.DURABILITY, 2, true);
    rum24M.addEnchant(Enchantment.PROTECTION_FIRE, 2, true);
    rum24M.addEnchant(Enchantment.DAMAGE_ALL, 4, true);
    rum24.setItemMeta(rum24M);
    ShapedRecipe recette25 = new ShapedRecipe(rum24);
  
    recette25.shape(new String[]{ " A ", " B ", " B " });
    recette25.setIngredient('A', Material.OBSIDIAN);
    recette25.setIngredient('B', Material.STICK);
  
    getServer().addRecipe(recette25);
  
    ItemStack rum25 = new ItemStack(Material.WOOD_SPADE, 1);
    ItemMeta rum25M = rum25.getItemMeta();
    rum25M.setDisplayName("Osidian spade");
    rum25M.addEnchant(Enchantment.DURABILITY, 2, true);
    rum25M.addEnchant(Enchantment.PROTECTION_FIRE, 2, true);
    rum25M.addEnchant(Enchantment.DAMAGE_ALL, 4, true);
    rum25.setItemMeta(rum25M);
    ShapedRecipe recette26 = new ShapedRecipe(rum25);
  
    recette26.shape(new String[]{ "A  ", "B  ", "B  " });
    recette26.setIngredient('A', Material.OBSIDIAN);
    recette26.setIngredient('B', Material.STICK);
  
    getServer().addRecipe(recette26);
  
    ItemStack rum26 = new ItemStack(Material.WOOD_SPADE, 1);
    ItemMeta rum26M = rum26.getItemMeta();
    rum26M.setDisplayName("Osidian spade");
    rum26M.addEnchant(Enchantment.DURABILITY, 2, true);
    rum26M.addEnchant(Enchantment.PROTECTION_FIRE, 2, true);
    rum26M.addEnchant(Enchantment.DAMAGE_ALL, 4, true);
    rum26.setItemMeta(rum26M);
    ShapedRecipe recette27 = new ShapedRecipe(rum26);
  
    recette27.shape(new String[]{ "  A", "  B", "  B" });
    recette27.setIngredient('A', Material.OBSIDIAN);
    recette27.setIngredient('B', Material.STICK);
  
    getServer().addRecipe(recette27);
  
    ItemStack rum27 = new ItemStack(Material.WOOD_SPADE, 1);
    ItemMeta rum27M = rum27.getItemMeta();
    rum27M.setDisplayName("Emerald spade");
    rum27M.addEnchant(Enchantment.DURABILITY, 4, true);
    rum27M.addEnchant(Enchantment.PROTECTION_FIRE, 4, true);
    rum27M.addEnchant(Enchantment.DAMAGE_ALL, 6, true);
    rum27.setItemMeta(rum27M);
    ShapedRecipe recette28 = new ShapedRecipe(rum27);
  
    recette28.shape(new String[]{ " A ", " B ", " B " });
    recette28.setIngredient('A', Material.EMERALD);
    recette28.setIngredient('B', Material.STICK);
  
    getServer().addRecipe(recette28);
  
    ItemStack rum28 = new ItemStack(Material.WOOD_SPADE, 1);
    ItemMeta rum28M = rum28.getItemMeta();
    rum28M.setDisplayName("Emerald spade");
    rum28M.addEnchant(Enchantment.DURABILITY, 4, true);
    rum28M.addEnchant(Enchantment.PROTECTION_FIRE, 4, true);
    rum28M.addEnchant(Enchantment.DAMAGE_ALL, 6, true);
    rum28.setItemMeta(rum28M);
    ShapedRecipe recette29 = new ShapedRecipe(rum28);
  
    recette29.shape(new String[]{ "A  ", "B  ", "B  " });
    recette29.setIngredient('A', Material.EMERALD);
    recette29.setIngredient('B', Material.STICK);
  
    getServer().addRecipe(recette29);
  
    ItemStack rum29 = new ItemStack(Material.WOOD_SPADE, 1);
    ItemMeta rum29M = rum29.getItemMeta();
    rum29M.setDisplayName("Emerald spade");
    rum29M.addEnchant(Enchantment.DURABILITY, 4, true);
    rum29M.addEnchant(Enchantment.PROTECTION_FIRE, 4, true);
    rum29M.addEnchant(Enchantment.DAMAGE_ALL, 6, true);
    rum29.setItemMeta(rum29M);
    ShapedRecipe recette30 = new ShapedRecipe(rum29);
  
    recette30.shape(new String[]{ "  A", "  B", "  B" });
    recette30.setIngredient('A', Material.EMERALD);
    recette30.setIngredient('B', Material.STICK);
  
    getServer().addRecipe(recette30);
  
    ItemStack rum30 = new ItemStack(Material.WOOD_PICKAXE, 1);
    ItemMeta rum30M = rum30.getItemMeta();
    rum30M.setDisplayName("Emerald pickaxe");
    rum30M.addEnchant(Enchantment.DURABILITY, 4, true);
    rum30M.addEnchant(Enchantment.PROTECTION_FIRE, 4, true);
    rum30M.addEnchant(Enchantment.DAMAGE_ALL, 6, true);
    rum30.setItemMeta(rum30M);
    ShapedRecipe recette31 = new ShapedRecipe(rum30);
  
    recette31.shape(new String[]{ "AAA", " B ", " B " });
    recette31.setIngredient('A', Material.EMERALD);
    recette31.setIngredient('B', Material.STICK);
  
    getServer().addRecipe(recette31);
  
    ItemStack rum31 = new ItemStack(Material.WOOD_PICKAXE, 1);
    ItemMeta rum31M = rum31.getItemMeta();
    rum31M.setDisplayName("Obsidian pickaxe");
    rum31M.addEnchant(Enchantment.DURABILITY, 2, true);
    rum31M.addEnchant(Enchantment.PROTECTION_FIRE, 2, true);
    rum31M.addEnchant(Enchantment.DAMAGE_ALL, 4, true);
    rum31.setItemMeta(rum31M);
    ShapedRecipe recette32 = new ShapedRecipe(rum31);
  
    recette32.shape(new String[]{ "AAA", " B ", " B " });
    recette32.setIngredient('A', Material.OBSIDIAN);
    recette32.setIngredient('B', Material.STICK);
  
    getServer().addRecipe(recette32);
  
    ItemStack rum32 = new ItemStack(Material.WOOD_HOE, 1);
    ItemMeta rum32M = rum32.getItemMeta();
    rum32M.setDisplayName("Obsidian hoe");
    rum32M.addEnchant(Enchantment.DURABILITY, 2, true);
    rum32M.addEnchant(Enchantment.PROTECTION_FIRE, 2, true);
    rum32M.addEnchant(Enchantment.DAMAGE_ALL, 2, true);
    rum32.setItemMeta(rum32M);
    ShapedRecipe recette33 = new ShapedRecipe(rum32);
  
    recette33.shape(new String[]{ "AA ", " B ", " B " });
    recette33.setIngredient('A', Material.OBSIDIAN);
    recette33.setIngredient('B', Material.STICK);
  
    getServer().addRecipe(recette33);
  
    ItemStack rum33 = new ItemStack(Material.WOOD_HOE, 1);
    ItemMeta rum33M = rum33.getItemMeta();
    rum33M.setDisplayName("Obsidian hoe");
    rum33M.addEnchant(Enchantment.DURABILITY, 2, true);
    rum33M.addEnchant(Enchantment.PROTECTION_FIRE, 2, true);
    rum33M.addEnchant(Enchantment.DAMAGE_ALL, 2, true);
    rum33.setItemMeta(rum33M);
    ShapedRecipe recette34 = new ShapedRecipe(rum33);
  
    recette34.shape(new String[]{ " AA", "  B", "  B" });
    recette34.setIngredient('A', Material.OBSIDIAN);
    recette34.setIngredient('B', Material.STICK);
  
    getServer().addRecipe(recette34);
  
    ItemStack rum34 = new ItemStack(Material.WOOD_HOE, 1);
    ItemMeta rum34M = rum34.getItemMeta();
    rum34M.setDisplayName("Emerald hoe");
    rum34M.addEnchant(Enchantment.DURABILITY, 4, true);
    rum34M.addEnchant(Enchantment.PROTECTION_FIRE, 4, true);
    rum34M.addEnchant(Enchantment.DAMAGE_ALL, 4, true);
    rum34.setItemMeta(rum34M);
    ShapedRecipe recette35 = new ShapedRecipe(rum34);
  
    recette35.shape(new String[]{ "AA ", " B ", " B " });
    recette35.setIngredient('A', Material.EMERALD);
    recette35.setIngredient('B', Material.STICK);
  
    getServer().addRecipe(recette35);
  
    ItemStack rum35 = new ItemStack(Material.WOOD_HOE, 1);
    ItemMeta rum35M = rum35.getItemMeta();
    rum35M.setDisplayName("Emerald hoe");
    rum35M.addEnchant(Enchantment.DURABILITY, 4, true);
    rum35M.addEnchant(Enchantment.PROTECTION_FIRE, 4, true);
    rum35M.addEnchant(Enchantment.DAMAGE_ALL, 4, true);
    rum35.setItemMeta(rum35M);
    ShapedRecipe recette36 = new ShapedRecipe(rum35);
  
    recette36.shape(new String[]{ " AA", "  B", "  B" });
    recette36.setIngredient('A', Material.EMERALD);
    recette36.setIngredient('B', Material.STICK);
  
    getServer().addRecipe(recette36);
  
  }
  public void onDisable()
  {
    System.out.println("[ThanhLong] NewTool OFF");
  }
}
 
Nhưng plugin new tools là newitem hả?
Đây chỉ là 1 code snippet, là 1 thứ rất nhỏ trong 1 cái plugin hoàn chỉnh
Code snippet thuờng là ví dụ trong lập trình, nguời đọc nó vẫn phải có kiến thức về Java tbh
 
Đây chỉ là 1 code snippet, là 1 thứ rất nhỏ trong 1 cái plugin hoàn chỉnh
Code snippet thuờng là ví dụ trong lập trình, nguời đọc nó vẫn phải có kiến thức về Java tbh
co lẽ e cũng k cần quan tam chi đến việc nayd :D rút!
 
ý bác là sao nhỉ thường tôi tháy notepad++ code html php htm v.v và plugins minecraft dt mà ta ?

Đến cả Notepad cài sẵn của win cũng code đc chứ đ riêng gì cái này nhé
 
Similar content Most view Xem thêm
Back
Top Bottom