Hey, I want to execute a command anywhere in a code. How can I do this?
Example:
if (act == Action.RIGHT_CLICK_AIR) {
Player p2 = e.getPlayer();
if(e.getPlayer().getInventory().getItemInHand().getId() == 1) {
p2.sendMessage(Main.pfx + "Teleporter online!");
//execute a command
}
Example:
if (act == Action.RIGHT_CLICK_AIR) {
Player p2 = e.getPlayer();
if(e.getPlayer().getInventory().getItemInHand().getId() == 1) {
p2.sendMessage(Main.pfx + "Teleporter online!");
//execute a command
}