The SystemBeforeEvents interface in @minecraft/server.
Interface in @minecraft/server
import type { SystemBeforeEvents } from '@minecraft/server';Example
Section titled “Example”import { system, type StartupEvent } from '@minecraft/server';
system.beforeEvents.startup.subscribe((event: StartupEvent) => { console.log('startup');});import { system } from '@minecraft/server';
system.beforeEvents.startup.subscribe((event) => { console.log('startup');});Properties
Section titled “Properties”startup
Section titled “startup”read-only
readonly startup: EventSignal<StartupEvent>;Fires once, after the plugin’s main module has run.
shutdown
Section titled “shutdown”read-only
readonly shutdown: EventSignal<ShutdownEvent>;Fires before the plugin is unloaded.