Date: 2023/10/06 07:16:36 UTC-07:00
Type: Denizen Script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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=4] chest:netherite_chestplate[enchantments:protection=4] legs:netherite_leggings[enchantments:protection=4] boots:netherite_boots[enchantments:protection=4]
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