#Why does my script have an error?

1 messages · Page 1 of 1 (latest)

fierce rose
#

[Scripting][error]-TypeError: cannot read property 'Events' of undefined at <anonymous> (test.js:4)

[Scripting][error]-Plugin [Reinforce iron golem BP - 1.4.0] - [test.js] ran with error: [TypeError: cannot read property 'Events' of undefined at <anonymous> (test.js:4)

This is the message that came up to my content log.

And this is my script which i have been testing.

import { world } from "@minecraft/server";

// This runs once when the world loads
world.before.Events.worldInitialize.subscribe(event => {
console.warn("Script API initialized successfully!");
});

im new to scripting so i don't know anything about this.

plain terrace
#

world.before.Events —> world.beforeEvents

Autocorrect?