SerenityJS
    Preparing search index...

    Class BlockContainer

    Represents a container.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    block: Block

    The block 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

    • 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