SerenityJS
    Preparing search index...

    Class EntityContainer

    Represents a container.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    entity: Entity

    The entity that this container is attached to.

    identifier: ContainerId

    The identifier of the container.

    occupants: Set<Player> = ...

    The occupants of the container.

    storage: (null | ItemStack)[]

    The storage of the container.

    type: ContainerType

    The type of the container.

    Accessors

    • get emptySlotsCount(): number

      The amount of empty slots in the container.

      Returns number

    Methods

    • Close the container for a player.

      Parameters

      • player: Player

        The player to close the container for.

      • serverInitiated: boolean = true

        Whether the close was initiated by the server.

      Returns void

    • Check if the container is owned by the player.

      Parameters

      • player: Player

        The player to check

      Returns boolean

      Returns true if the container is owned by the player, false otherwise

    • Swaps items in the container.

      Parameters

      • slot: number

        The slot to swap the item from.

      • otherSlot: number

        The slot to swap the item to.

      • OptionalotherContainer: Container

        The other container to swap the item to.

      Returns void