Paste #105877: Unnamed Denizen Script Paste

Date: 2023/02/01 06:05:52 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


LavaFishing:
  type: world
  debug: false
  events:
    after player fishes:
      ## throw hook into lava
      - if <player.world.contains[nether]> && <player.is_online> && <context.hook.is_spawned>:
        - waituntil rate:1t max:5s <context.hook.location.material.contains[lava]>
        - define SplashLocation <context.hook.location>
        # Hook entering liquid effect
        - playeffect LAVA at:<[SplashLocation]> quantity:20 offset:0.3,0.1,0.3 visibility:50 velocity:0,2,0
        - playeffect CAMPFIRE_COSY_SMOKE at:<[SplashLocation]> quantity:1 offset:0.3,0.1,0.3 visibility:50 velocity:0,0.01,0
        - playsound ENTITY_GENERIC_EXTINGUISH_FIRE at:<[SplashLocation]>
        # End of effect
#        - run LavaFishingEvent
        - drop HookPlaceHolder <[SplashLocation]>
        - attach <context.hook> to:<[SplashLocation].find_entities.within[0.3].filter[has_flag[HookPlaceHolder]].get[1]>
        - while <context.hook.is_spawned>:
          - if <context.hook.location.is_liquid> && <context.hook.location.material.contains[lava]> && <context.hook.is_spawned>:
            - narrate "<&7><&o>Hook in <&c><&o>LAVA<&7><&o>!"
          - else:
#            - run LavaFishingReelIn
            - stop
          - wait 5t

#LavaFishingReelIn:
#  type: task
#  debug: false
#    - define tmpRod <player.inventory.slot[HAND]>
#    - inventory set origin:<item[air]> destination:<player.inventory> slot:HAND
#    - wait 1t
#    - inventory set origin:<[tmpRod]> destination:<player.inventory> slot:HAND

#LavaFishingEvent:
#  type: task
#  debug: false
#  script:
#    - define TimeToCatch <util.random.decimal[5].to[60].round>s
#    - wait <[TimeToCatch]>
#    - animate <player> ARM_SWING

HookPlaceHolder:
    type: item
    material: netherite_sword
    display name: <element[HookPlaceHolder].color_gradient[from=#A5F4FF;to=#3ED4E8]>
    mechanisms:
      custom_model_data: 1901

HookPlaceHolderFlagging:
  type: world
  debug: false
  events:
    on HookPlaceHolder spawns:
      - flag <context.entity> HookPlaceHolder
    on player picks up HookPlaceHolder:
      - determine cancelled