How would I go about creating this recipe?

Discussion in 'Plugin Development' started by SnowGears, Dec 29, 2012.

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

    SnowGears

    When I try to make a shapeless recipe requiring a stack of 20 redstone and gold armor, I get the error that a shapeless recipe cannot have more than 9 items. Is there a way I could create a recipe like this:
    [​IMG]

    Any help would be great. Thanks!
     
  2. Offline

    GodzOfMadness

    Minecraft does not work like that Tooner
     
  3. Offline

    MP5K

    hello
    try something like this: (i haven' tested but i should work fine.)
    PHP:
        public ShapelessRecipe YOUR_RECIPE null// set this to your Recipe
       
        
    @EventHandler(ignoreCancelledtrue)
        public 
    void onCraft(CraftItemEvent event){
            if(!(
    event.getRecipe() instanceof ShapelessRecipe)) return;
            
    ShapelessRecipe rec = (ShapelessRecipeevent.getRecipe();
            if(
    YOUR_RECIPE.equals(rec)){
                if(
    event.getInventory().contains(new ItemStack(Material.REDSTONE 20))){
                    
    event.getInventory().remove(event.getInventory().first(new ItemStack(Material.REDSTONE 20)));
                }else 
    event.setCancelled(true);
            }
        }
     
  4. Offline

    SnowGears

    This did not work for me. I still cannot figure out how to do this...
     
  5. Offline

    SgtStud

    This ^

    You will not be able to make recipes that require more than one item in one spot. I "think" you can do this with client modding, and perhaps spoutcraft, but other than that you're out of luck
     
    Tooner101 likes this.
  6. Offline

    SnowGears

    Okay that makes sense. I was hoping it was possible but... oh well. What about on an anvil? Is there a way to have the armor in the first slot, then the 20 redstone in the second slot?
     
  7. Offline

    SgtStud

    Now you're thinking. I'm not really sure exactly how anvils work, but there is a chance it could work. Lemme look this up

    EDIT:
    Unfortunetly, from what I can tell, no. The only way I could think of doing this would be to make a listener for an itemcreationevent (or whatever it is) with a recipe of 1 redstone and diamond armor and if they have 19 other redstone in the players inventory allow the event, else cancel it. I think that could work...
     
  8. This would be client side! -_-
     
  9. Offline

    Bulldogg9098

    Another option: implement and create a redstone dust block, requiring 4 redstone dust.
    Then, require the armor to use 5 redstone blocks (20 dust total) and the armor.
     
  10. Offline

    fireblast709

    no you can listen to the PrepareItemCraftEvent, check the recipe, check the inventory, and if the recipe matches but the inventory does not, act accordingly
     
  11. Offline

    SgtStud

    Exactly. As I said previously, this should be doable.
     
Thread Status:
Not open for further replies.

Share This Page