1
Plugin Dev Error - Please Help!
Hi, I am working on a plugin that has a block break listener. When a dirt block is broken, i want it to be replaced with a stone block. so far, i've gotten it to be able to replace the blocks around the broken block, but not the actual block being broken. Please Help! Heres a pastebin of my current code:
http://pastebin.com/prfAp0rT
http://pastebin.com/prfAp0rT
7
[deleted]
It still wont actually replace the dirt block to stone.. :/
Heres my updated code:
http://pastebin.com/E6t7a8vS
Heres my updated code:
http://pastebin.com/E6t7a8vS
[deleted]
THANKS! it works now!
[deleted]
When I have that code, it tells me that i broke a dirt block, like before, but it doesnt actually replace the dirt with stone..
if(block.getType() == Material.DIRT) {
block.setType(Material.STONE);
player.sendMessage("You mined a dirt block!");
}
else {
return;
}
What this code does in game is when i break a dirt block, it doesnt get replaced, but it doesnt drop anything either. it just disapears
if(block.getType() == Material.DIRT) {
block.setType(Material.STONE);
player.sendMessage("You mined a dirt block!");
}
else {
return;
}
What this code does in game is when i break a dirt block, it doesnt get replaced, but it doesnt drop anything either. it just disapears
You're getting the relative blocks around the block you broke
if(block.getType() == Material.DIRT) {
block.setType(Martial.STONE)
}
else {
return false;
}
if(block.getType() == Material.DIRT) {
block.setType(Martial.STONE)
}
else {
return false;
}
