-
New Feature
-
Resolution: Invalid
-
Minor
-
None
-
None
-
1.20.1
-
Yes
If I have created a plugin that allows players to send message privatly, here are a part of codes:
// in onCommand method: // strings[0] == A Player's Name // strings[1] == A Text want to tell to others privatly Bukkit.getPlayer(strings[0]).sendMessage(strings[1]);
Then I have to execute the in-game commands:
/privatespeak Steve Hello
But, as a player, I want to change my target to a nearest player, and tell him to come to my home to get his prize, I will exactly write this:
/privatespeak @p Come-to-my-home
However, the Target Selector @p is not a player's name. Then the plugin will throw an error because nobody in the server named "@p".
So how can I achieve this just like the original in-game commands /msg ?
Or is it possible to reprint the command /msg using plugins?