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
Try this for the block break event... setting the bed to air setting surrounding blocks that are bed to air getDrops().cleardrops();
@sentostv For your second question: Code: World.dropItem(loc, new ItemStack(material, -->amount<--));
@meguy26 i sugest you keep Spoonfeeding as low as it gets, the code above is not much of a deal but generally speaking :- )
@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.
@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.
@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.