Paste #50358: on player crafts

Date: 2018/10/23 08:08:10 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


Non-working players craft:

CustomStuffHandler:
    type: world
    events:
        on player right clicks with Hawthorn:
        - if "<player.flag[Hawthorn Cooldown]>" {
          - narrate "Hawthorn is cooling down..."
          } else {
          - flag player "Hawthorn Cooldown" duration:3s
          - shoot e@fireball height:0.05 gravity:0.01
          }
        on player crafts Hawthorn: 
        - if <player.has_flag[FirstBossKilled].not>: 
          - narrate "You need to kill the first boss to craft this" 
          - determine cancelled 

#Items

Hawthorn:
   type: item
   material: i@stick
   display name: <green>Hawthorn
   enchantments:
   - durability: 1
   recipe:
   - i@blaze_powder|i@stick|i@blaze_powder
   - i@air|i@stick|i@air
   - i@air|i@stick|i@air


Working players craft: 

CustomStuffHandler:
    type: world
    events:
        on player crafts diamond_hoe: 
        - if <player.has_flag[FirstBossKilled].not>: 
          - narrate "You need to kill the first boss to craft this" 
          - determine cancelled