Hi! I have a little problem. I don't know how to make it I would like to send a command on action. That mean: player do sth(action) > action = command. For example: when player left click on block then this action execute /kill command for this player (just like that when player type /kill in chat but its important to player dont know that he sent a command) Code: if(event.getAction() == Action.LEFT_CLICK_BLOCK){ //AND HERE ACTION SEND A COMMAND } I really need help with that
TGF Do this: Code:java if(event.getAction() == Action.LEFT_CLICK_BLOCK){player.performCommand("kill");} Although, if you just want the player to die, do this: Code:java player.setHealth(0);
You are great I'm gonna check this but I'm sure it's a solution for me. Can I override permissions on some way? For example player don't have perms to /gm. But when he click on block he perform command /gm successful.
Then hmm. Is it possible to block executing specific command for a player? Then I would like to give to player perm gm.* and block executing this from chat but execute only with left click action.
I guess you could do this: Code: getServer().dispatchCommand(getServer().getConsoleSender(), "command "+player.getName()); That code would make the console perform the command "command <player name>"! May I ask what gm does? EDIT by Moderator: merged posts, please use the edit button instead of double posting.
GodMode It was example, It's can be about all commands. Can You look to http://forums.bukkit.org/threads/operations-on-schematics.105465/ thread? EDIT by Moderator: merged posts, please use the edit button instead of double posting.
you could just give the permission peform the command and then remove the permission if he didn't had it before