Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
store player health (voxel.js plugin)
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
.travis.yml
README.md
health.js
package.json
test.js

README.md

voxel-health

Stores player health value (voxel.js plugin)

Build Status

(for UI, see also voxel-health-bar)

Usage

Load with voxel-plugins, options:

  • maxHealth (10), minHealth (0): valid health value range, outside will be clamped
  • startHealth (defaults to maxHealth): initial starting health value

API

Methods:

  • hurt(amount)
  • heal(amount)

Events:

  • health: emitted with new and old value on any change
  • hurt, heal: emitted when hurt and healed, respectively
  • die: emitted when health reaches minimum

License

MIT

Something went wrong with that request. Please try again.