Paste #116088: zombie equip

Date: 2023/10/06 07:11:47 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


axe_item:
    type: item
    material: wooden_axe
    display name: <&6>Legendary <&3><bold>Axe
    lore:
    - <&6><bold>LEGENDARY <&f>Weapon
    enchantments:
    - efficiency:5
    mechanisms:
      unbreakable: true
      custom_model_data: 1
      hides: ENCHANTS
axe_ability:
    type: world
    events:
        on player tries to attack entity:
        - if <player.item_in_hand> matches axe_item:
            - if <player.has_flag[axe_ability]>:
                - narrate targets:<player> "Cooldown: <player.flag_expiration[axe_ability].from_now.formatted>"
                - determine passively cancelled
                - stop
            - run axe_ability_task def:<context.entity>
            #- flag <player> expire:5s axe_ability:used
            #- itemcooldown wooden_axe duration:5s
        on player right clicks entity:
        - ratelimit <player> 1t
        - narrate targets:<player> "Armor: <context.entity.armor_bonus>"
        - narrate targets:<player> "Health: <context.entity.health>"
        on zombie spawns:
        - equip <context.entity> hand:diamond_sword head:netherite_helmet[enchantments:protection] chest:netherite_chestplate legs:netherite_leggings boots:netherite_boots
axe_ability_task:
    type: task
    definitions: context_entity
    script:
    #- narrate targets:<player> test!
    - playeffect at:<[context_entity].location> effect:crit_magic offset:1 quantity:200
    - playeffect at:<[context_entity].location> effect:crit offset:1 quantity:200
    - if <[context_entity].armor_bonus> <= 6:
        - hurt <[context_entity].armor_bonus> <[context_entity]> cause:CUSTOM
    - hurt <[context_entity].armor_bonus.mul[0.4].round_up_to_precision[0.5]> <[context_entity]> cause:CUSTOM
    - narrate targets:<player> "Health: <[context_entity].health>"
    - wait 5t
custom_totem_effect_axe:
    type: task
    script:
    - fakeequip <player> offhand:TOTEM_OF_UNDYING[custom_model_data=2] duration:1t for:<player>
    - animate animation:TOTEM_RESURRECT for:<player>
    - adjust <player> stop_sound