Paste #34975: Edit of P#34973 Torch Light

Date: 2016/07/23 19:55:03 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


# +----------------------
# | Torch Light
# |
# | Light from your torch without placing it!
# +----------------------
#
# @author mcmonkey
# @denizen-version 0.9.8
# @version 1.2
#
# Installation:
# Just drop it in your scripts folder :)
#
# Usage:
# Hold a torch and run around! Also works in your offhand!
#
# +----------------------

torch_light_world:
    type: world
    debug: false
    events:
        on player steps on block:
        - if <player.has_flag[torch_light_prev]> {
          - light <context.previous_location> reset
          - flag player torch_light_prev:!
          }
        - if <player.item_in_hand.material.name||null> == torch || <player.item_in_offhand.material.name||null> == torch {
          - light <context.location.add[0,1,0]> 14
          - flag player torch_light_prev
          }
        on player quits:
        - if <player.has_flag[torch_light_prev]> {
          - light <context.previous_location> reset
          - flag player torch_light_prev:!
          }

torch_light_version:
  type: version
  name: Torch Light
  id: 13
  description: Lights your way!
  version: 1.2