SerenityJS
    Preparing search index...

    Class ItemStackSpawnEggTrait

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    entityType: null | EntityIdentifier = null

    The entity type that this spawn egg will spawn.

    identifier: string = ...

    The identifier of the trait.

    item: ItemStack

    The item stack that this trait is attached to.

    component: null | typeof ItemTypeComponent | typeof ItemTypeComponent[] = null

    The item component(s) that this trait is compatible with by default. If null, the trait will not attach to any item stack by default.

    identifier: "spawn_egg"

    The identifier of the trait.

    tag: "minecraft:spawn_egg"

    The item tag(s) that this trait is compatible with by default. If null, the trait will not attach to any item stack by default.

    types: string[] = []

    The item type identifiers that this trait is compatible with by default.

    Methods

    • Sets the probability of this trait being randomly ticked each tick.

      Parameters

      • numerator: number

        The numerator of the probability fraction.

      • denominator: number

        The denominator of the probability fraction.

      Returns void

    • Wether this trait should be randomly ticked this tick.

      Parameters

      • factor: number = 1

        A factor to multiply the chance by. Default is 1.

      Returns boolean

      True if the trait should be randomly ticked, false otherwise.