I don’t know how to explain this, but I really need help.
I created a command, and I do not know what to do next, I searched a lot where, but I did not find how to complete this.
What I need:
1) There are two modes in this command, "on" and "off", I want to make it so that when it was "on", it was impossible to write "on" again and vice versa.
2) When I switch to "Moderation" mode, that is, I write "on", then the Action Bar would appear with a "timer", as long as I am in this mode, that is, "You are in Moderation mode: 1 minute, 7 seconds", and so that it later writes to the chat when I write "off", that is, "You were in moderation mode 1 minute, 7 seconds."
If you have any thoughts what is wrong with this command, then you can correct them as well.i
I created a command, and I do not know what to do next, I searched a lot where, but I did not find how to complete this.
What I need:
1) There are two modes in this command, "on" and "off", I want to make it so that when it was "on", it was impossible to write "on" again and vice versa.
2) When I switch to "Moderation" mode, that is, I write "on", then the Action Bar would appear with a "timer", as long as I am in this mode, that is, "You are in Moderation mode: 1 minute, 7 seconds", and so that it later writes to the chat when I write "off", that is, "You were in moderation mode 1 minute, 7 seconds."
Code:
command /spectate [<text>]:
permission: Essentials.gamemode
permission message: &cNo perms.
trigger:
if arg 1 is "on":
set gamemode of player to spectator
apply potion of night vision 2 to the player for 1000 days
apply potion of speed 1 to the player for 1000 days
hide the player from all players
message "&aModeration - ON" to player
send title "" with subtitle "&fModeration - ON." to player for 10 seconds with fadein 1 second and fade out 1 second
if arg 1 is "off":
set gamemode of player to survival
reveal the player from all players
remove night vision from the player
remove speed from the player
message "&aModeration - OFF" to player
send title "" with subtitle "&fModeration - OFF" to player for 3 seconds with fadein 1 second and fade out 1 second
if arg 1 is not "off" or "on":
message "&fUsage - &a/spectate (on/off)"
If you have any thoughts what is wrong with this command, then you can correct them as well.i