Solved Recipe code help

Discussion in 'Plugin Development' started by Glass_Eater84, Jun 18, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Glass_Eater84

    Hello,
    I have some code here:
    saddle recipe is working but nametag isn't not sure if its because I formated it wrong.
    Code:java
    Code:java
    1. package me.glasseater.uncraftables;
    2. [LIST=1]
    3. [*]import org.bukkit.Bukkit;
    4. import org.bukkit.Material;
    5. import org.bukkit.inventory.ItemStack;
    6. import org.bukkit.inventory.ShapedRecipe;
    7. import org.bukkit.plugin.java.JavaPlugin;
    8. public class Main extends JavaPlugin{
    9. public void onEnable(){
    10. Bukkit.getConsoleSender().sendMessage("Uncraftables has been enabled!");
    11. ShapedRecipe saddle = new ShapedRecipe(new ItemStack(Material.SADDLE, 1));
    12. saddle.shape("LLL","LSL"," I ").setIngredient('L', Material.LEATHER).setIngredient('S', Material.STRING).setIngredient('I', Material.IRON_INGOT);
    13. Bukkit.getServer().addRecipe(saddle);
    14. ShapedRecipe nametag = new ShapedRecipe(new ItemStack(Material.NAME_TAG, 1));
    15. nametag.shape("AAA","BBB","BCB").setIngredient('A', Material.IRON_INGOT).setIngredient('B', Material.GOLD_INGOT).setIngredient('C', Material.IRON_BLOCK);
    16. Bukkit.getServer().addRecipe(nametag);
    17. }
    18. public void onDisable(){
    19. Bukkit.getServer().clearRecipes();
    20. }
    21. }
    22. [/LIST]

    1. But the thing is the nametag recipe is not working but the saddle one is.
    I am hoping someone can help resolve this issue.
    Best Regards,
    Glass

    bump

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 8, 2016
  2. Offline

    mine-care

    You get any errors?
     
  3. Offline

    LordVakar

    Glass_Eater84
    Don't bump within 24 hours.
    Are you sure you are crafting the nametag right?
    I literally see no difference between how the saddle worked and the nametag didn't because of how the code is used in the same way
     
  4. Offline

    Glass_Eater84

    mine-care Nope
    LordVakar What do you mean "crafting it right" its a custom recipe.
    But idk what I am doing wrong :/
     
  5. Offline

    LordVakar

    Glass_Eater84
    I mean what I said I meant. ._.
    ARE YOU PUTTING THE CORRECT ITEMS into the crafting table correctly?

    Try:
    nametag.shape("AAA","BBB","BCB");
    nametag.setIngredient('A', Material.IRON_INGOT);
    nametag.setIngredient('B', Material.GOLD_INGOT);
    nametag.setIngredient('C', Material.IRON_BLOCK);
    Bukkit.getServer().addRecipe(nametag);
     
  6. Offline

    AoH_Ruthless

    LordVakar
    That's the same exact thing..

    Glass_Eater84
    Little off topic but ... that's a pretty op nametag. 12 iron and 5 gold? Damn.
     
  7. Offline

    LordVakar

    AoH_Ruthless
    I know I'm just trying to put it in a different way of code to see if it works xP
     
  8. Offline

    Glass_Eater84

    AoH_Ruthless
    Yea :p I am just coming up with these on the spot. Not to mention that they are incredibly hard to find, and can only be found in dungeons.

    Problem now solved. Thanks for your help everyone.
    - Glass

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 8, 2016
Thread Status:
Not open for further replies.

Share This Page