Hey all,
Is there a plugin where you can click a block and it will run a command?
Is there a plugin where you can click a block and it will run a command?
Are you 1IQyes, a command block Lol[DOUBLEPOST=1571678949][/DOUBLEPOST]but if u want people to waste time ngl we can do it :d
If someone is looking for a simple plugin like this, I'm sure they don't know how to compile that code. Plus you only gave them an event. Plus that would only be usable to run one command when you click on any block in the world. And you don't have to check if the block type is not air after checking if the Action is clicking a block. And you could just use "e.getClickedBlock().getType() != Material.AIR" instead of "!e.getClickedBlock().getType() == Material.AIR".Time for sudo code
@EventHandler
public void onBlockInteract(PlayerInteractEvent e){
if(e.getAction() == Action.LEFT_CLICK_BLOCK || e.getAction() == Action.RIGHT_CLICK_BLOCK){
if(!e.getClickedBlock().getType() == Material.AIR) {
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), "broadcast test")
}
}
}
