So I'm trying to make a nuclear bomb in Minecraft so I tried to make a custom TNT block on placement, but I can't seem to trigger the action of creating the explosion at the block location. May I have some help?
Here's the code...
package com.TheRealBee.Bows.Event9;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.block.Block;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockPlaceEvent;
public class EventManager9 implements Listener {
@EventHandler
public static void onBlockPlace(BlockPlaceEvent e) {
Block b = e.getBlock();
Location blocklocation = b.getLocation();
if (e.getBlockPlaced().equals(ChatColor.AQUA+"Nuclear bomb")){
blocklocation.getWorld().createExplosion(blocklocation, 5, true);
}
}
}