Help. im learning java. send command to console as player?

Status
This thread has been locked.

Rainy

Premium
Feedback score
4
Posts
963
Reactions
140
Resources
0
so im leaning java and im working on my first main plugin. its a punish gui plugin. so i working on the bans bit and currently im just sending the command to the console and it would just say
"console banned [playername] for reason" is there a way i can send a command to the console as a player so it would say "[playername] banned [playername] for reason" if this makes sense? or is there another way.

im new to java coding and still learning. i would appreciate any help and advice.
 
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

Turtle

turtle#1989
Supreme
Feedback score
17
Posts
751
Reactions
419
Resources
0
Bukkit.getServer().dispatchCommand(player, command);

or

player.chat("/" + command);
 

Rainy

Premium
Feedback score
4
Posts
963
Reactions
140
Resources
0

Rainy

Premium
Feedback score
4
Posts
963
Reactions
140
Resources
0
Don't feel dumb.
Take it as an opportunity to improve and remove the need to ask other people for your programming issues.
Thanks for the feedback.[DOUBLEPOST=1495205891][/DOUBLEPOST]
Bukkit.getServer().dispatchCommand(player, command);

or

player.chat("/" + command);
i did use that but if the player doesnt have the perm it would not work. for example im using litebans. i wanted to make the plugin so servers can just give there staff one permission instead of having 20 liteban permissions and there own group, if that makes sense.
 
Last edited:

Turtle

turtle#1989
Supreme
Feedback score
17
Posts
751
Reactions
419
Resources
0
Thanks for the feedback.[DOUBLEPOST=1495205891][/DOUBLEPOST]
i did use that but if the player doesnt have the perm it would not work. for example im using litebans. i wanted to make the plugin so servers can just give there staff one permission instead of having 20 liteban permissions and there own group, if that makes sense.
try dispatch command for player
 

sores

MineBOI
Premium
Feedback score
5
Posts
305
Reactions
210
Resources
0
Thanks for the feedback.[DOUBLEPOST=1495205891][/DOUBLEPOST]
i did use that but if the player doesnt have the perm it would not work. for example im using litebans. i wanted to make the plugin so servers can just give there staff one permission instead of having 20 liteban permissions and there own group, if that makes sense.
If you're using the LiteBans ban command, they would still need the perm.
 
Status
This thread has been locked.
Top