# scriptserver-helpers

> Random helpers module for scriptserver

Latest version **0.0.6** (published 2015-12-28) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install scriptserver-helpers
pnpm add scriptserver-helpers
yarn add scriptserver-helpers
bun add scriptserver-helpers
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2015-12-28 |
| First published | 2015-10-26 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Garrett Cox |
| Maintainers | garrettjoecox |

## Links

- npm: https://www.npmjs.com/package/scriptserver-helpers
- Repository: https://github.com/garrettjoecox/scriptserver-helpers
- Homepage: https://github.com/garrettjoecox/scriptserver-helpers#readme
- Issues: https://github.com/garrettjoecox/scriptserver-helpers/issues
- npm.io page: https://npm.io/package/scriptserver-helpers

## Dependencies (1)

- [scriptserver](https://npm.io/package/scriptserver.md) *

## Recent versions

- 0.0.6 (latest) — 2015-12-28
- 0.0.5 — 2015-12-11
- 0.0.4 — 2015-11-20
- 0.0.3 — 2015-11-11
- 0.0.2 — 2015-10-27
- 0.0.1 — 2015-10-26

## README

scriptserver-helpers
====================

[![](http://i.imgur.com/zhptNme.png)](https://github.com/garrettjoecox/scriptserver)

FYI: This package is an addon for ScriptServer and requires ScriptServer to be set up, please see [here](https://github.com/garrettjoecox/scriptserver) for more information.

## Installation
While in root directory of your server run:
```
npm install scriptserver-helpers
```
And in your `server` file:
```javascript
server.use('scriptserver-helpers');
```

## Usage
This module provides the following basic helper functions to help developers get started with modules.
```javascript
// .testForBlock(coords, type)
// Returns whether or not the block at the given coords matches the given type
server.testForBlock({x: 0, y: 75, z: 0}, 'air')
  .then(result => {
    if (result) doSomething();
    else doSomethingElse();
  });

// .isOnline(username)
// Returns whether or not the player is online
server.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.wait(1000))
  .then(() => doSomethingElse());

// .getCoords(username)
// Returns coordinates of given user if online
server.getCoords('ProxySaw')
  .then(coords => {
    console.log(coords.x);
    console.log(coords.y);
    console.log(coords.z);
  });

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

---
_Source: https://npm.io/package/scriptserver-helpers · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
