Hello, I am making a plugin sort of like Splegg, however I want it so that after x amount of hits the block breaks, not just 1. I'm a bit confused on how to do this. Would I have to store the block locations in a file? There would be multiple blocks getting hit. Would I just store the amount of times the block is hit in a arraylist, I don't think that would work. How would I make the block not break? In case you don't understand my jiberish here is an example Example: I have a gun, that shoots eggs. After you hit a block 5 times, then it breaks. If you only hit it once it doesn't break.
I don't think this is possible. If it is, I recommend taking a look at the java docs for the proper listener: http://jd.bukkit.org/
1Achmed1 No this is possible. So like in your example mydeblob , check for when an egg hits the ground and if the player has a gun and then you could save the location maybe in a file or check if it already exists. Then, with the location increase how many hits. And if when you increase the block, if the number of hits =<5 then make the block air and drop the block.
Use each block's metadata to record the hits. Code:java if (!Block.hasMetadata("hitcount")){ Block.setMetadata("hitcount", 1) } else if(Block.getMetadata("hitcount") == 5){ break the block } else{ Block.setMetadata("hitcount",Block.getMetadata("hitcount")+1) }