laser_pointer

A pointable laser. Reports its facing, firing state, redstone output, range, and color; color and rainbow mode are scriptable.

getAxis()Get the laser's facing direction.
isFiring()Check whether the laser is currently firing.
getPower()Get the output redstone power.
getRange()Get the laser's effective range.
getColor()Get the laser color.
setColor(color)Set the laser color.
isRainbow()Check whether rainbow mode is enabled.
setRainbow(rainbow)Toggle rainbow color mode.
getAxis()Source

Get the laser's facing direction.

Returns

  1. string The serialized direction name.
isFiring()Source

Check whether the laser is currently firing.

Returns

  1. boolean True if firing.
getPower()Source

Get the output redstone power.

Returns

  1. number Output redstone power 0..15 (post-inversion).
getRange()Source

Get the laser's effective range.

Returns

  1. number The laser range.
getColor()Source

Get the laser color.

Returns

  1. number ARGB-packed color int as used by the block.
setColor(color)Source

Set the laser color.

Parameters

  1. color number ARGB-packed color int.
isRainbow()Source

Check whether rainbow mode is enabled.

Returns

  1. boolean True if rainbow mode is on.
setRainbow(rainbow)Source

Toggle rainbow color mode.

Parameters

  1. rainbow boolean True to enable rainbow mode.