Sign In

operatorAdded

This event is fired when an operator was added

v1.0.0+

Register the event

Enable operatorAdded in events in your ForgeMinecraft options in index.js:

const { ForgeClient } = require("@tryforge/forgescript")
const { ForgeMinecraft } = require("@tryforge/forge.minecraft")

const minecraft = new ForgeMinecraft({
  events: [
    "operatorAdded"
  ]
})

const client = new ForgeClient({
  events: [
    "clientReady"
  ],
  intents: [
    "Guilds"
  ],
  extensions: [
    minecraft
  ]
})

Handle the event

Listen and react when operatorAdded is triggered using an inline command or an external handler file:

minecraft.commands.add({
  type: "operatorAdded",
  code: `$log[operatorAdded event was triggered!]`
})

Was this page helpful?