@minecraft/server

    Class SpawnRulesRegistryBeta

    Container for spawn rules APIs. Allows for registering callbacks to extend the spawner system.

    Required Experiments:

    • Simplified Spawn Rules
    Index

    Methods

    • Beta

      Parameters

      • id: string

        The Id to associate the callback with.

      • callback: (arg0: EntitySpawnCallbackArgs) => boolean

        The callback that will be invoked when a spawner tests for the associated predicate key.

      Returns void

      Registers an entity spawn callback to the provided key.

      This function can't be called in read-only mode.

      This function can be called in early-execution mode.

      This function can throw errors.

      minecraftcommon.InvalidArgumentError

      NamespaceNameError

      SpawnRulesInvalidRegistryError

    • Beta

      Parameters

      • id: string

        The Id to associate the callback with.

      • callback: (arg0: ObstructionCallbackArgs) => boolean

        The callback that will be invoked when a spawner tests for the associated predicate key.

      Returns void

      Registers an obstruction callback to the provided key.

      This function can't be called in read-only mode.

      This function can be called in early-execution mode.

      This function can throw errors.

      minecraftcommon.InvalidArgumentError

      NamespaceNameError

      SpawnRulesInvalidRegistryError

    MMNEPVFCICPMFPCPTTAAATR