[Answered]How to change what spout blocks drop?

Discussion in 'Plugin Development' started by msw1, Nov 10, 2011.

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

    msw1

    Newb question here, how do I change my spout block from dropping cobblestone on breaking instead of itself?
     
  2. Offline

    Jogy34

    after you initialize it it do this
    Code:
    //change 'customBlock' to the variable name of your custom block
    SpoutItemStack drop = new SpoutItemStack(customBlock, 1);
    customBlock.setItemDrop(drop);
    
     
  3. Offline

    msw1

    Thanks! But, my game can't find anything called SpoutItemStack (Yes I use eclipse) what do I do? Is there something I need to import my eclipse is failing at?
     
  4. Offline

    TheDuceCat

    Code:
    ItemStack drop = new ItemStack(Material.COBBLESTONE, 1);
    This will drop one cobblestone.
     
  5. Offline

    Jogy34

    Do you have the spout API library imported into eclipse.
     
  6. Offline

    msw1

    Of course I do, how else would I have made a custom block?

    That won't work because I'm using spout, and custom blocks are not materials.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 21, 2016
  7. Offline

    Jogy34

    This is my exact code with a plugin that I'm developing and it works fine.
    Code:
    SpoutItemStack eG1Drop = new SpoutItemStack(eG1Seeds, 0);
    eG1Block.setItemDrop(eG1Drop);
    
    Also make sure that this is in your onEnable.
     
  8. Offline

    tips48

    You need to update SpoutAPI, SpoutItemStack isnt in the rb yet
     
  9. Offline

    msw1

    It works now, thanks.
     
Thread Status:
Not open for further replies.

Share This Page