Skip to content

Commit

Permalink
Update registerWorldDynamicProperties.js (#288)
Browse files Browse the repository at this point in the history
  • Loading branch information
defowler2005 authored Jul 12, 2023
1 parent 8476411 commit 9e31b90
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DynamicPropertiesDefinition, world } from "@minecraft/server";

world.events.worldInitialize.subscribe(({propertyRegistry}) => {
world.afterEvents.worldInitialize.subscribe(({propertyRegistry}) => {
// add boolean dynamic property
const dynamicProperty = new DynamicPropertiesDefinition();
dynamicProperty.defineBoolean("my_boolean");
Expand All @@ -22,4 +22,4 @@ world.setDynamicProperty("my_string", 'Hi mom');

world.getDynamicProperty("my_boolean"); // true
world.getDynamicProperty("my_number"); // 100
world.getDynamicProperty("my_string"); // 'Hi mom'
world.getDynamicProperty("my_string"); // 'Hi mom'

0 comments on commit 9e31b90

Please sign in to comment.