How would I change a TNT's fuse time. Then put the countdown in chat. And how would I make it when I use blaze powder on tnt the tnt turns in to prime tnt
I got some code together Code:java @EventHandler public void Command(PlayerInteractEvent event) { Player player = event.getPlayer(); if(event.getAction().equals(Action.RIGHT_CLICK_BLOCK) && player.getItemInHand().getType().equals(Material.FLINT_AND_STEEL) && event.getClickedBlock().getType().equals(Material.TNT)){ event.setCancelled(true); event.getClickedBlock().setType(Material.AIR); TNTPrimed tnt = (TNTPrimed) event.getClickedBlock().getWorld().spawn(event.getClickedBlock().getLocation().add(0, 1, 0), TNTPrimed.class); tnt.setFuseTicks(30); } } you can replace Material.FLINT_AND_STEEL with anything
PizzaPixel this should work Code:java @EventHandlerpublic void Command(PlayerInteractEntityEvent event) {Player player = event.getPlayer();if(player.getItemInHand().getType().equals(Material.SHEARS) && event.getRightClicked() instanceof TNTPrimed){TNTPrimed tnt = (TNTPrimed)event.getRightClicked();tnt.setFuseTicks(30);}}
What do you mean it's not just making it back to TNT? You made it seem like what you wanted was to make it unprimed TNT, that would be regular TNT If you meant resetting the countdown of the fuse, then the answer is in the above posts
I want that when you hit primed tnt with shears it turns to tnt but I want this to add it to a mini game plugin I'm making
So then just check if the TNT is primed when you hit it with shears, and if it is, replace that block with a TNT block that isn't primed
PizzaPixel tyler53 sorry i missunderstood you add this to the code and remove tnt.setfuse() Code:java tnt.getLocation().getBlock().setType(Material.TNT);tnt.remove();