This package has been deprecated

Author message:

Deprecated - Moved to @scriptserver/util

scriptserver-util

1.2.1 • Public • Published

Deprecated - Moved to @scriptserver/util

FYI: This package is an addon for ScriptServer and requires ScriptServer to be set up, please see here for more information.

Installation

While in root directory of your server run:

npm install scriptserver-util

And in your server file:

server.use(require('scriptserver-util'));

Usage

This module provides the following basic helper functions to help developers get started with modules.

// .isOnline(username)
// Returns whether or not the player is online
server.util.isOnline('ProxySaw')
  .then(result => {
    if (result) doSomething();
    else doSomethingElse();
  });

// .wait(ms)
// Waits a given time (milliseconds) then continues to next promise in chain
server.doSomething(withSomething)
  .then(() => server.util.wait(1000))
  .then(() => doSomethingElse());

// .getLocation(username)
// Returns coordinates & dimension of given user if online
server.util.getLocation('ProxySaw')
  .then(loc => {
    console.log(loc.x);
    console.log(loc.y);
    console.log(loc.z);
    console.log(loc.dimension)
  });

// .tellRaw(text, target, options)
// Uses the minecraft command tellRaw to tell [target] [text] with [options]
server.util.tellRaw('Something went wrong!', '@a', {color: 'red'});

Readme

Keywords

none

Package Sidebar

Install

npm i scriptserver-util

Weekly Downloads

3

Version

1.2.1

License

GPL-3.0

Unpacked Size

7.55 kB

Total Files

4

Last publish

Collaborators

  • garrettjoecox