@bedrock-oss/bedrock-boost
    Preparing search index...

    Class CommandUtils

    This is a collection of utility methods for working with commands until a proper API is available. Once a proper API is available and stable, I'll change function to use that instead and mark it as deprecated.

    Index

    Constructors

    Methods

    • Adds camera shake effect to the specified player.

      Parameters

      • player: Player

        The player to apply the camera shake effect to.

      • type: CameraShakeType

        The type of camera shake effect.

      • intensity: number

        The intensity of the camera shake effect.

      • duration: number

        The duration of the camera shake effect in seconds.

      Returns void

    • Destroys the block as if it's broken by a player.

      Parameters

      • dimension: Dimension

        The dimension in which to destroy the block.

      • location: Vector3

        The location of the block to destroy.

      Returns void

    • Checks if an entity have items matching the specified matchers.

      Parameters

      • entity: Entity

        The entity to check.

      • matchers: ItemMatcher[]

        The matchers to check.

      Returns boolean

      True if the entity has items matching the matchers, false otherwise.

      This method uses the testfor command and hasitem selector, so that you can check for the data of the item.

    • Sets the input permission for a player.

      Parameters

      • player: Player

        The player for whom to set the input permission.

      • permission: InputPermission

        The input permission to set.

      • value: boolean

        The value to set the input permission to.

      Returns void

      Use player.inputPermissions.setPermissionCategory instead.

    • Stops the camera shake for the specified player.

      Parameters

      • player: Player

        The player for whom to stop the camera shake.

      Returns void