Options
All
  • Public
  • Public/Protected
  • All
Menu

This is the documentation for the velt/helpers module. The velt-helpers module contains functionality that isn't necessarily part of Velt's core, but is generally still very useful when you need it. It contains one export with plenty of different utility functions and classes.

Index

References

default

Renames and exports helpers

Variables

Const helpers

helpers: { CustomMob: typeof CustomMob; Direction: typeof Direction; EntityWrapper: typeof EntityWrapper; Gui: typeof Gui; Inventory: typeof Inventory; Item: typeof Item; Pathfinder: typeof Pathfinder; Scoreboard: typeof Scoreboard; attrs: attrs; clearEffects: clearEffects; distBetween: distBetween; drop: typeof drop; effect: effect; equip: equip; give: give; lookingAt: lookingAt; shoot: shoot; swap: typeof swap }

Type declaration

  • CustomMob: typeof CustomMob
  • Direction: typeof Direction
  • EntityWrapper: typeof EntityWrapper
  • Gui: typeof Gui
  • Inventory: typeof Inventory
  • Item: typeof Item
  • Pathfinder: typeof Pathfinder
  • Scoreboard: typeof Scoreboard
  • attrs: attrs
  • clearEffects: clearEffects
  • distBetween: distBetween
  • drop: typeof drop
  • effect: effect
  • equip: equip
  • give: give
  • lookingAt: lookingAt
  • shoot: shoot
  • swap: typeof swap

Functions

Const attrs

  • attrs(entity: any): {}
  • Get a wrapper around the attributes of any given entity

    Parameters

    • entity: any

      The entity to get attributes of

    Returns {}

    • [prop: string]: any

Const clearEffects

  • clearEffects(entity: any): void
  • Clear all effects from an entity.

    Parameters

    • entity: any

      The entity to clear effects from

    Returns void

Const distBetween

  • distBetween(start: any, end: any): number
  • Get the distance between any two locations, or any two objects that can be casted to locations (like entities)

    Parameters

    • start: any

      The first location or object that can be casted to a location

    • end: any

      The second location or object that can be casted to a location

    Returns number

Const drop

  • drop(item: any, loc: any): void
  • Drop an item at a location.

    Parameters

    • item: any

      The item to drop

    • loc: any

      The location to drop it at

    Returns void

Const effect

  • effect(...entity: any, ...arg1: string & EffectOpts, ...opts: EffectOpts): void
  • Effect an entity with a specific effect with an optional duration and amplifier.

    Parameters

    • Rest ...entity: any

      The entity to effect

    • Rest ...arg1: string & EffectOpts
    • Rest ...opts: EffectOpts

      The options, optional if you're specifying only the effect, contains options like duration and amplifier.

    Returns void

Const equip

  • equip(entity: any, equipment: Equipment): void
  • Equip any entity with items for their main hand, offhand, or armor.

    Parameters

    • entity: any

      The entity to equip.

    • equipment: Equipment

      The equipment to provide them with.

    Returns void

Const give

  • give(entity: any, ...items: any[]): void
  • Give one or more items to any entity.

    Parameters

    • entity: any

      The entity to give the items to.

    • Rest ...items: any[]

      The items to give.

    Returns void

Const lookingAt

  • lookingAt(entity: any, range?: number): any
  • Return the target that the entity is looking at.

    Parameters

    • entity: any

      The entity whose looking at the target.

    • Optional range: number

      The range of how far away the target can be at the most.

    Returns any

Const shoot

  • shoot(entity: any, proj: string, opts?: ShootOpts): any
  • Shoot a projectile from an entity.

    Parameters

    • entity: any

      The entity to shoot the projectile from

    • proj: string

      The projectile type to shoot

    • Optional opts: ShootOpts

      The optional options such as the speed and direction

    Returns any

Const swap

  • swap(entity: any, other: any): void
  • Swap the positions of any two entities.

    Parameters

    • entity: any

      The entity to swap with the other entity's position

    • other: any

      The second entity to swap with the first entity's position

    Returns void

Generated using TypeDoc