I am fond of the guillotine for executions; it's quick and if you setup a large pegboard and some buckets right beneath it you can also enjoy a game of Plinko On a more serious note, is this for a plugin you are making or do you need an already made solution?
In the plugin, you can use this: Code (Text): Bukkit.dispatchCommand(CommandSender, "command"); This should work, CommandSender is an entity that executes the command. It can be a Player, or a console, or anyone that can execute a command. If you want a full list of subinterfaces that extends CommandSender interface, just look here If you want to execute a player to do a command without coding your own plugin, you can use many specific ways. For example, you can send clickable message using tellraw, you can use Command Blocks aswell.