Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface BedComponent

Component object.

Hierarchy

Index

Properties

__identifier__

__identifier__: string

The identifier of the component, e.g., "minecraft:position", or "minecraft:nameable"

__type__

__type__: "component"

The type of the object

Methods

add

  • add(ent: IEntity | BedEntity, existsOk: boolean): void
  • Add the component to an entity.

    Parameters

    • ent: IEntity | BedEntity
    • existsOk: boolean

      If false an error will be thrown if the component already exists on the entity.

    Returns void

data

  • data(ent: IEntity | BedEntity, data?: object | Function): IComponent<unknown> | null | void
  • Get or set the data of an entity.

    Parameters

    • ent: IEntity | BedEntity

      The identifier of the entity.

    • Optional data: object | Function

      The data to change provided as an object or as a Function that takes and returns a value.

    Returns IComponent<unknown> | null | void

has

  • Check if an entity has a component.

    Parameters

    • ent: IEntity | BedEntity

      The identifier of the entity.

    Returns boolean

reload

  • Reload the component.

    Parameters

    • ent: IEntity | BedEntity

      The identifier of the entity.

    Returns void

remove

  • Remove the component from an entity.

    Parameters

    • ent: IEntity | BedEntity

      The identifier of the entity.

    Returns void

Generated using TypeDoc