Date: 2024/11/14 12:25:27 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 right clicks block with:SnowCannon:
- determine passively cancelled
- take iteminhand quantity:1
- spawn BountifulGiftEntity <player.location.below[1.4]>
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]>
- define newitem <context.item>
- adjust <[newitem]> lore:<[newlore]>
- inventory set o:<[newitem]> d:<context.inventory> slot:<context.raw_slot>