Options
All
  • Public
  • Public/Protected
  • All
Menu

@magikcraft/core

Index

Type aliases

TaskCallback

TaskCallback: function

Type declaration

    • (iterations?: undefined | number): void
    • Parameters

      • Optional iterations: undefined | number

      Returns void

Variables

Const BUKKIT_BOSSBAR_TYPE

BUKKIT_BOSSBAR_TYPE: "org.inventivetalent.bossbar.BossBarAPI" = "org.inventivetalent.bossbar.BossBarAPI"

Const DISABLE_WATCH_RELOAD

DISABLE_WATCH_RELOAD: boolean = java.lang.System.getenv('DISABLE_WATCH_RELOAD') === 'true'

Const HAS_BOSSBAR

HAS_BOSSBAR: boolean = hasBossBar

Const HAS_BOSSBAR_BUKKIT

HAS_BOSSBAR_BUKKIT: boolean = bossBarBukkit

Const HAS_BOSSBAR_NUKKIT

HAS_BOSSBAR_NUKKIT: boolean = bossBarNukkit

Const HAS_HOLOGRAM

HAS_HOLOGRAM: boolean = hasHolograms

Const HAS_HOLOGRAM_BUKKIT

HAS_HOLOGRAM_BUKKIT: boolean = hologramBukkit

Const HAS_HOLOGRAM_NUKKIT

HAS_HOLOGRAM_NUKKIT: boolean = hologramNukkit

Const HEALTHCHECKS_IO_URL

HEALTHCHECKS_IO_URL: any = java.lang.System.getenv('HEALTHCHECKS_IO_URL')

Const IS_BUKKIT

IS_BUKKIT: boolean = !IS_NUKKIT

Const IS_NUKKIT

IS_NUKKIT: boolean = plugins.Pokkit != null

Const IS_SCRIPTCRAFT

IS_SCRIPTCRAFT: boolean = plugins.Scriptcraft != null

Const NUKKIT_BOSSBAR_TYPE

NUKKIT_BOSSBAR_TYPE: "io.magikcraft.BossBarAPI.BossBar" = "io.magikcraft.BossBarAPI.BossBar"

Const NUKKIT_HOLOGRAM_TYPE

NUKKIT_HOLOGRAM_TYPE: "gt.creeperface.holograms.api.HologramAPI" = "gt.creeperface.holograms.api.HologramAPI"

Const TextComponent

TextComponent: any = hasBukkitBossBar? Java.type('net.md_5.bungee.api.chat.TextComponent'): undefined

Const commando

commando: any = require(`/${serverDir}/scriptcraft/plugins/commando/commando`).commando

Const gettext

gettext: gettext = localiser(lang).gettext

Const memento

memento: _setItem = _setItem

Functions

Const ComponentBuilder

  • ComponentBuilder(msg: string): IComponentBuilder

DurableMap

  • DurableMap(name: any): any
  • Return a DurableMap - a disk-backed memory that survives JS engine refresh

    Parameters

    • name: any

      a unique name

    Returns any

HashMapToJSObject

  • HashMapToJSObject(hm: any): any
  • These are utilities to convert Java objects to native JavaScript types

    Parameters

    • hm: any

    Returns any

_setItem

  • _setItem(key: any, value: any): void

aspecto

  • aspecto(): any

Const bar

  • bar(msg?: undefined | string, player?: BukkitPlayer): Bar
  • bar(msg?: string, player: BukkitPlayer): NukkitBossBar

celeritate

  • celeritate(speed?: number): void

create

  • create(): any

declaro

  • declaro(itemToDeclare: any): void

dixit

  • dixit(msg: string | any, playerName?: any): void
  • Parameters

    • msg: string | any
    • Default value playerName: any = self.getName()

    Returns void

doNTimes

  • doNTimes(action: any, nTimes?: number, delay?: number, callback?: any): void
  • Parameters

    • action: any
    • Default value nTimes: number = 1
    • Default value delay: number = 100
    • Optional callback: any

    Returns void

exmemento

  • exmemento(key?: string): any
  • Parameters

    • Default value key: string = "memory.default"

    Returns any

exsultus

  • exsultus(power?: number | string): void
  • Parameters

    • Default value power: number | string = 50

    Returns void

get

  • get(): any

getItem

  • getItem(key?: string): any
  • Parameters

    • Default value key: string = defaultKey

    Returns any

Const getPlayer

  • getPlayer(player: any): any

getSender

  • getSender(): any

Const hic

  • hic(): any

iacta

  • iacta(playerName: any): void

ianuae

  • ianuae(location: any): void

icePath

  • icePath(): void

incendium

  • incendium(playerName: any, duration: any): void

infierno

  • infierno(quantity?: number): void

init

  • init(): void

interpolate

  • interpolate(_msg: string, ...args: (string | number)[]): string
  • Interpolate arguments to replace occurrences of %s Will interpolate an empty string for missing arguments

    So: interpolate('Player %s was %s by %s', 'sitapati', 'killed', 'a dragon') returns: 'Player sitapati was killed by a dragon'

    export

    Parameters

    • _msg: string
    • Rest ...args: (string | number)[]

    Returns string

Const localiser

  • Return a localiser. This can load locale strings, and transform a given source string to the correct locale

    Parameters

    • Default value locale: string = "en"

    Returns ILocaliser

locationFromJSON

  • locationFromJSON(maybeLocation?: any): any

locationToJSON

  • locationToJSON(location: any): undefined | object

Const logger

  • logger(namespace: string): (Anonymous function)
  • This function returns a namespaced log function. The log function takes one argument and an optional second argument.

    Parameters

    • namespace: string

    Returns (Anonymous function)

Const memory

  • memory(): any

noxvida

  • noxvida(duration: any): void

potion

  • potion(type: any, __namedParameters: object): void
  • Parameters

    • type: any
    • __namedParameters: object

    Returns void

radiatum

  • radiatum(playerName: any): void

Const random

  • random(min?: number, max?: number): number
  • Parameters

    • Default value min: number = 1
    • Default value max: number = 10

    Returns number

satio

  • satio(): void

shakti

  • shakti(loc: any): void

sizeOf

  • sizeOf(object: any): number

spectris

  • spectris(): void

stella

  • stella(location: any): void

Const type

  • type(name: any): any

viburnum

  • viburnum(amount?: number, delay?: number): void
  • Parameters

    • Default value amount: number = 1
    • Default value delay: number = 200

    Returns void

volare

  • volare(duration: any): void

Object literals

Let BossBar

BossBar: object

bar

bar: bar

color

color: object

Type declaration

style

style: object

Type declaration

Const color

color: object

BLUE

BLUE: any = BossBarAPI.Color.BLUE

GREEN

GREEN: any = BossBarAPI.Color.GREEN

PINK

PINK: any = BossBarAPI.Color.PINK

PURPLE

PURPLE: any = BossBarAPI.Color.PURPLE

RED

RED: any = BossBarAPI.Color.RED

WHITE

WHITE: any = BossBarAPI.Color.WHITE

YELLOW

YELLOW: any = BossBarAPI.Color.YELLOW

Const fs

fs: object

copyDir

  • copyDir(srcPath: string, destPath: string): Promise<Object>
  • Parameters

    • srcPath: string
    • destPath: string

    Returns Promise<Object>

exists

  • exists(filename: any): any
  • exists

    Parameters

    • filename: any

      path to file, relative to Minecraft server root

    Returns any

    Checks if file or directory exists.

readDir

  • readDir(path: any): string[]

readFile

  • readFile(filename: any): string
  • readFile

    Parameters

    • filename: any

      path to file, relative to Minecraft server root

    Returns string

    Reads the contents of a file from the filesystem.

readJson

  • readJson(path: string, options?: object): any
  • Parameters

    • path: string
    • Default value options: object = { throwException: true }

    Returns any

remove

  • remove(filename: any): void
  • remove

    Parameters

    • filename: any

      path to file, relative to Minecraft server root

    Returns void

    Delete file or directory (recursive).

writeFile

  • writeFile(filename: string, content: string): void
  • writeFile

    Parameters

    • filename: string

      path to file, relative to Minecraft server root

    • content: string

      file content to write

    Returns void

    Writes the contents of a file to the filesystem.

writeJSON

  • writeJSON(path: string, json: object): void
  • Parameters

    • path: string
    • json: object

    Returns void

Const plugins

plugins: object

BossBarAPI

BossBarAPI: any = pluginManager.getPlugin('BossBarAPI')

Pokkit

Pokkit: any = pluginManager.getPlugin('Pokkit')

Scriptcraft

Scriptcraft: any = pluginManager.getPlugin('Scriptcraft')

ScriptcraftMultiEngine

ScriptcraftMultiEngine: any = pluginManager.getPlugin('Scriptcraft-ME')

Const style

style: object

NOTCHED_10

NOTCHED_10: any = BossBarAPI.Style.NOTCHED_10

NOTCHED_12

NOTCHED_12: any = BossBarAPI.Style.NOTCHED_12

NOTCHED_20

NOTCHED_20: any = BossBarAPI.Style.NOTCHED_20

Generated using TypeDoc