Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Rush;
- import org.bukkit.Bukkit;
- import org.bukkit.Location;
- import org.bukkit.Material;
- import org.bukkit.block.Block;
- import org.bukkit.entity.EntityType;
- import org.bukkit.event.EventHandler;
- import org.bukkit.event.Listener;
- import org.bukkit.event.entity.EntityExplodeEvent;
- import org.bukkit.plugin.java.JavaPlugin;
- public class TestTush extends JavaPlugin implements Listener{
- public void onEnable(){
- Bukkit.getPluginManager().registerEvents(this, this);
- }
- @EventHandler
- public void onBlockExplode(EntityExplodeEvent e) {
- for(Block block : e.blockList()) {
- if(block.getLocation() == new Location(block.getWorld() ,-116, 79, 56)){
- if(block.getType() == Material.BED_BLOCK || block.getType() == Material.BED) {
- block.setType(Material.AIR) ;
- }
- }
- if(block.getType() == Material.TNT){
- block.setType(Material.AIR);
- block.getWorld().spawnEntity(block.getLocation(), EntityType.PRIMED_TNT);
- }
- }
- e.setCancelled(true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment