BedWars help

Discussion in 'Plugin Development' started by sentostv, Apr 25, 2015.

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

    sentostv

    Dear Community,

    I have a problem programming BedWars.

    I want to make it that if someone breaks the bed of a other team that this will simply remove

    like event.getBlock().setType(Materiel.AIR); But now I have a problem because if you clear the drops of these block and you break the headside of the bed it will drop as if you dont have cleared the drops how can I do this?!

    And then I have another Question if I spawn a Item with World.dropItem(loc, item); Then there are always dropping 3 Items...

    Thanks for helping

    sentostv
     
  2. Offline

    Zombie_Striker

    Try this for the block break event...
    • setting the bed to air
    • setting surrounding blocks that are bed to air
    • getDrops().cleardrops();
     
  3. Offline

    meguy26

    @sentostv
    For your second question:
    Code:
    World.dropItem(loc, new ItemStack(material, -->amount<--));
     
  4. Offline

    mine-care

    @meguy26 i sugest you keep Spoonfeeding as low as it gets, the code above is not much of a deal but generally speaking :- )
     
  5. Offline

    meguy26

    @mine-care
    Its one line of code, that is not even filled out with proper values...
    Would you rather i said:
    "The itemstack constructor allows for an amount"? Personally I think that the code I posted speaks that quite well.
     
  6. @meguy26
     
    mine-care likes this.
  7. Offline

    meguy26

    @bwfcwalshy
    Yeah I know.

    Its just sometimes I think people do benefit from so called "spoon-feeding." Personally it is much easier when someone replies with code, especially when the methods I am looking for are too far away from my realm of coding. Now, I then go and learn what the code is doing, and that is what truly makes "spoonfeeding" worthwhile, if the recipient just copy-pastes the code then nothing is gained, but learning WHY the code works is a great benefit.
     
  8. @meguy26 Some people may benefit but most don't, they just copy the code and don't bother learning so they run into errors later. Anyway, let's get back on topic. There are tons of threads arguing spoonfeeding already.
     
  9. Offline

    meguy26

Thread Status:
Not open for further replies.

Share This Page