Перейти к основному содержанию

GameController

Methods for manipulating player with world, use callbacks of callbacks in their implementation.

@since

2.4.0b120

Index

Functions

attack

  • attack(entityUid: number): void
  • Triggers server-side "PlayerAttack" and "EntityHurt".


    Parameters

    • entityUid: number

    Returns void

buildBlock

  • buildBlock(x: number, y: number, z: number, side: number): void
  • Triggers server-side "BuildBlock".


    Parameters

    • x: number
    • y: number
    • z: number
    • side: number

    Returns void

continueBuildBlock

  • continueBuildBlock(x: number, y: number, z: number, side: number): void
  • Parameters

    • x: number
    • y: number
    • z: number
    • side: number

    Returns void

continueDestroyBlock

  • continueDestroyBlock(x: number, y: number, z: number, side: number): boolean
  • Triggers client-side "DestroyBlockContinue" and "DestroyBlockStart" (on zero progress).


    Parameters

    • x: number
    • y: number
    • z: number
    • side: number

    Returns boolean

destroyBlock

  • destroyBlock(x: number, y: number, z: number, side: number): void
  • Triggers server-side "BreakBlock" and "DestroyBlock" (if not prevented).


    Parameters

    • x: number
    • y: number
    • z: number
    • side: number

    Returns void

interact

  • interact(entityUid: number, x: number, y: number, z: number): void
  • Triggers server-side "EntityInteract".


    Parameters

    • entityUid: number
    • x: number
    • y: number
    • z: number

    Returns void

onItemUse

  • onItemUse(x: number, y: number, z: number, side: number): void
  • Triggers server-side "ItemUse" and "ItemUseServer" with client-side "ItemUseLocal" and "ItemUseLocalServer".


    Parameters

    • x: number
    • y: number
    • z: number
    • side: number

    Returns void

releaseUsingItem

  • releaseUsingItem(): void
  • Returns void

startBuildBlock

  • startBuildBlock(x: number, y: number, z: number, side: number): void
  • Parameters

    • x: number
    • y: number
    • z: number
    • side: number

    Returns void

startDestroyBlock

  • startDestroyBlock(x: number, y: number, z: number, side: number): boolean
  • @remarks

    Can break a block that breaks instantly.


    Parameters

    • x: number
    • y: number
    • z: number
    • side: number

    Returns boolean

stopBuildBlock

  • stopBuildBlock(): void
  • Returns void

stopDestroyBlock

  • stopDestroyBlock(x: number, y: number, z: number): void
  • Interrupts destruction animation.


    Parameters

    • x: number
    • y: number
    • z: number

    Returns void