Script API - v1.19.70
    Preparing search index...

    Contains information and methods that can be used at the initialization of the scripting environment for a World. Also, use the supplied propertyRegistry object to register any dynamic properties, within the scope of the World Initialize execution.

    Index

    Constructors

    Properties

    Constructors

    Properties

    propertyRegistry: PropertyRegistry

    Contains methods for scripts to initialize and register dynamic properties they may wish to use within a world.

    import { DynamicPropertiesDefinition, MinecraftEntityTypes, world } from "@minecraft/server";

    world.events.worldInitialize.subscribe((e) => {
    let def = new DynamicPropertiesDefinition();

    def.defineNumber("rpgStrength");
    def.defineString("rpgRole", 16);
    def.defineBoolean("rpgIsHero");

    e.propertyRegistry.registerEntityTypeDynamicProperties(def, MinecraftEntityTypes.skeleton);
    });