Sign In

serverStopping

This event is fired when the server is stopping

v1.0.0+

Register the event

Enable serverStopping 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: [
    "serverStopping"
  ]
})

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

Handle the event

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

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

Was this page helpful?