Перейти к основному содержанию

MobSpawnRegistry

@deprecated

Use behavior packs to register spawning entities in server or use callbacks.

Index

Interfaces

SpawnInterface

SpawnInterface:

condition

condition: () => boolean

Type declaration

    • (): boolean
    • Returns boolean

optionaldenyNaturalDespawn

denyNaturalDespawn?: boolean

rarity

rarity: number

type

type: number

Functions

executeSpawn

  • executeSpawn(spawn: SpawnInterface, position: { x: number; z: number }): void
  • Parameters

    • spawn: SpawnInterface
    • position: { x: number; z: number }
      • x: number
      • z: number

    Returns void

getRandPosition

  • getRandPosition(): { x: number; z: number }
  • Returns { x: number; z: number }

    • x: number
    • z: number

getRandomSpawn

  • getRandomSpawn(rarityMultiplier: number): any
  • Parameters

    • rarityMultiplier: number

    Returns any

registerSpawn

  • registerSpawn(entityType: number, rarity: number, condition?: () => boolean, denyNaturalDespawn?: boolean): void
  • Parameters

    • entityType: number
    • rarity: number
    • optionalcondition: () => boolean
      • optionaldenyNaturalDespawn: boolean

      Returns void