Date: 2024/11/14 09:34:23 UTC-08:00
Type: Denizen Script
SnowCannon:
type: item
material: player_head
display name: <&f><&l>Snow <&8><&l>Cannon
lore:
- <&7>A sower of chaos and destruction
- <&7>Ammo: <&f>0
- <&f>
- <&8>Drag snowballs into it within
- <&8>inventory to reload
- <&8>Click to fire
mechanisms:
skull_skin: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjQ5NmM2MTk0MjlkYmUzODhhOGNjNThkNDdjNjljMDc2MzA4NmJjZjljOWQzNGZjODVkODYxNWYxMzVmZmNjYyJ9fX0=
SnowCannonClick:
type: world
debug: false
events:
on player clicks SnowCannon in inventory with:snowball:
- determine passively cancelled
- define input <context.cursor_item.quantity>
- define ammo <context.item.lore.get[2].substring[11]>
- define newlore <context.item.lore.set[<&7>Ammo:<&sp><&f><[input].add[<[ammo]>]>].at[2]>
#- adjust <context.inventory> <context.inventory.slot[<context.slot>]> lore:<[newlore]>
- inventory set o:<[newlore]> d:<context.inventory> slot:<context.slot>