Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Server

The wrapper around the server provided by Velt.

Hierarchy

  • Server

Index

Properties

anyEvent

anyEvent: Symbol

callbacks

callbacks: Record<string | number | symbol, any[]>

offlinePlayers

offlinePlayers: any[]

An array of all players who have ever joined.

onlinePlayers

onlinePlayers: any[]

An array of all players online.

plugins

plugins: Plugins

waiting

waiting: Record<string | number | symbol, any>

Methods

after

  • after(delay: Time): Promise<any>
  • after(delay: Time, callback: () => any): void
  • Wait a specific amount of time before doing something else asynchronously.

    Parameters

    • delay: Time

      The delay to wait.

    Returns Promise<any>

  • Parameters

    • delay: Time
    • callback: () => any
        • (): any
        • Returns any

    Returns void

broadcast

  • broadcast(msg: string, permission?: string): void
  • Broadcast a message to every user, or optionally every user with some specific permission.

    Parameters

    • msg: string

      The message to broadcast

    • Optional permission: string

      The optional permission users will need to see the broadcast

    Returns void

defaultWorld

  • defaultWorld(): any
  • Get the default world of the server

    Returns any

enchant

  • enchant(name: string): any
  • Get an enchantment from its Spigot name. For example, damage all will work, but not sharpness.

    alias

    enchantment

    Parameters

    • name: string

      The enchantment name (eg. knockback)

    Returns any

enchantment

  • enchantment(name: string): any
  • Get an enchantment from its Spigot name. For example, damage all will work, but not sharpness.

    Parameters

    • name: string

      The enchantment name (eg. knockback)

    Returns any

format

  • format(text: string): string
  • Format an enum-like text to be nicer. (Eg. ZOMBIFIED_PIGLIN to zombified piglin)

    Parameters

    • text: string

      The text to format

    Returns string

isMob

  • isMob(entity: any, type: string): boolean
  • Check if any entity is of the given mob type.

    Parameters

    • entity: any

      The entity to check.

    • type: string

      The entity-type to make sure they're of. (eg. zombie)

    Returns boolean

itemflag

  • itemflag(name: string): any
  • Get an itemflag from its Spigot name. For example, `hide enchants'.

    Parameters

    • name: string

      The itemflag name (eg. hide attributes)

    Returns any

itemstack

  • itemstack(material: string, opts?: string | {}): any
  • Get an itemstack from the material name and the options.

    Parameters

    • material: string
    • Optional opts: string | {}

    Returns any

material

  • material(name: string): any
  • Get a material type from its name.

    Parameters

    • name: string

      The name of the material (eg. diamond sword)

    Returns any

playerFromName

  • playerFromName(name: string): any
  • Get a player from their username.

    Parameters

    • name: string

      The name of the player.

    Returns any

reboot

  • reboot(): void
  • Restart the server.

    alias

    restart

    Returns void

restart

  • restart(): void
  • Restart the server.

    alias

    shutdown

    Returns void

schedule

  • schedule(time: Time): Scheduler
  • schedule(time: Time, callback: (count: number) => any): Scheduler
  • Schedule a task to run repeatedly after a specific amount of time passes

    Parameters

    • time: Time

      The amount of time that needs to pass for it to repeat

    Returns Scheduler

  • Parameters

    • time: Time
    • callback: (count: number) => any
        • (count: number): any
        • Parameters

          • count: number

          Returns any

    Returns Scheduler

shutdown

  • shutdown(): void
  • Shutdown the server.

    Returns void

skull

  • skull(player: any, opts: {}): any
  • Get a skull from a player.

    Parameters

    • player: any

      The player whose skull to get.

    • opts: {}

      The options

    Returns any

skullFromUUID

  • skullFromUUID(uuid: string): any
  • Get a skull from the UUID of the player who owned it.

    Parameters

    • uuid: string

      The UUID of the player who's skin represents the skull.

    Returns any

stop

  • stop(): void
  • Shutdown the server.

    Returns void

summon

  • summon(name: string, loc: any): any
  • Summon an entity at any given location

    Parameters

    • name: string

      The name of the entity-type (eg. zombie) that you'd like to spawn

    • loc: any

      The location of where to spawn it

    Returns any

unformat

  • unformat(text: string): string
  • Convert some normal text to an enum. (Eg. zombified piglin to ZOMBIFIED_PIGLIN)

    Parameters

    • text: string

      The text to un format

    Returns string

world

  • world(name: string): any
  • Find a world from a specific name

    Parameters

    • name: string

      The name of the world to find

    Returns any

worlds

  • worlds(): any[]
  • List all worlds in the server

    Returns any[]

Generated using TypeDoc