Paste #12528: Untitled Paste

Date: 2015/01/02 12:57:59 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


lantern1: 
  type: world 
  debug: true 
  events: 
    on player steps on block: 
    - if <player.location.light> <= 5 && <player.location.sub[0,0.1,0].material.is_solid||false> {
      - if <player.item_in_hand> == i@torch || <player.has_flag[lanternon]> {
        - showfake m@glowstone <context.previous_location.add[0,-1,0]> d:6t 
        - wait 1t
        - if <c.new_location.simple> == <player.location.simple> {
          - showfake m@glowstone <player.location.standing_on> d:5m
          }
        }
      }
    on player right clicks with i@fueledlantern:
    - if <player.flag[lanternon]||false> {
      - flag player fuelleft:<player.flag[lanternon].expiration>
      - flag player lanternon:!
      - showfake m@glowstone <player.location.add[0,-1,0]> d:6t 
      }
      else if !<player.flag[fuelleft]||true> {
      - flag player lanternon d:<player.flag[fuelleft]>
      - flag player fuelleft:!
      - showfake m@glowstone <player.location.add[0,-1,0]> d:5m 
      }
      else {
      - flag player lanternon d:5m
      - showfake m@glowstone <player.location.add[0,-1,0]> d:5m 
      }
    on player flag lanternon expires:
    - showfake m@glowstone <player.location.add[0,-1,0]> d:6t 
    - take i@fueledlantern
    - give i@lantern
lantern:
  type: item
  material: m@glass_bottle
  display name: lantern
  lore: 
  - this lantern needs fuel


lanternfuel:
  type: item
  material: m@potion,8236
  display name: lantern_fuel

fueledlantern:
  type: item
  material: m@glass_bottle
  display name: lantern
  lore:
  - right click to turn this lantern on
  - right click again to turn it off
  recipe: 
  - i@lanternfuel|i@air|i@air 
  - i@lantern|i@air|i@air 
  - i@air|i@air|i@air