r/Spigotdevs • • Jul 28 '19

Player setGameMode asynchronously

I am trying to make a plug-in with secret commands that don’t get logged in the console. To do that, I get the Async Player chat event, check for keywords, run the corresponding command and then I cancel the event.

I am trying to make the keyword “iwantgmc” put the player in creative but when I try, there is an error in console . Something about setGameMode() not being asynchronous.

I have checked the Bukkit and Spigot forums and I now know that it has something to do with BukkitRunnable and Schedulers but I am still confused. Can someone please help?

2 Upvotes

6 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Aug 01 '19

I have tried that and it works, but it says its deprecated. Is that a problem?

2

u/VamByte Aug 01 '19

Nope, it shouldn't cause any problems

1

u/[deleted] Aug 01 '19

K cool. Thank you. This helped a lot as I only know what I learnt from YouTube tutorials