Crafting Recipes don't work for certain slots

Discussion in 'Plugin Development' started by devjoll, Aug 6, 2016.

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

    devjoll

    I'm (very) new to plugin developing and I'm starting by making a simple plugin that extends the number of crafting recipes available in the game. One of the ones I want to include is turning a block of quartz back into four quartz items but it only works if the block is place in either the bottom left or bottom right slots. All other crafting slots yield nothing. A similar issue with blaze rods being crafted with blaze powder

    Here is a link to the code I'm using: http://pastebin.com/EWQahv1d
    Here is a link to screenshots of what work for blaze powder and what doesn't: http://imgur.com/a/DLchT
     
    Last edited: Aug 7, 2016
  2. Offline

    x_Jake_s

    https://bukkit.org/threads/how-to-make-custom-crafting-recipes.301328/
    Shows how you would create it in basic terms but as for your code
    Code:
        @Override
        public void onEnable() {
    
            ItemStack quartz = new ItemStack(Material.QUARTZ, 4);
            ShapedRecipe quartzCrystal = new ShapedRecipe(quartz);
            quartzCrystal.shape("  *","   ","   ")
    quartzCrystal.shape("  "," *","  ")
    quartzCrystal.shape("  ","  "," *")
    
    
            quartzCrystal.setIngredient('*', Material.QUARTZ_BLOCK);
            getServer().addRecipe(quartzCrystal);
        }
    I believe that might be the fix as you need to specific that '*' which is your block can be placed in all areas but that may be incorrect the thread above explains it way better so I suggest looking over that.
     
  3. @devjoll
    If you make a shapeless recipe, users can place the crafting ingredient anywhere.
     
  4. Offline

    devjoll

    Okay I'll try this for the quartz, but the blaze rods need to be shaped I'm assuming? Because I'd like to have the recipe be like crafting wood planks into sticks (one on top of the other). Sorry if I'm asking too many questions I want to git gud so I can make more advanced plugins.

    Edit: Shapeless recipe works for quartz
     
    Last edited: Aug 7, 2016
Thread Status:
Not open for further replies.

Share This Page