# Item Throwing Skill for Denizen # By: Xarieste ## For best results when using the "stuck" function, use custom_model_data to change how the item looks when equipped to the head slot. # This is a sample item with the flag necessary to use this skill Example_Item: type: item material: wooden_axe display name: Wooden Throwing Axe lore: - An axe that can be thrown. allow in material recipes: false flags: throwing_skill: throwing_skill Item_Skills: type: world debug: true defintions: generic_attack_damage events: # This event throws the item: on player right clicks block: - if : - shoot snowball[item=] origin: shooter: speed:1 - take iteminhand - define generic_attack_damage save:generic_attack_damage ## This event allows the player to remove a stuck thrown item from their enemy's head (can be removed if not using "stuck" function): on entity damaged by player with:air: - ratelimit 1t - if : - stop - else if : - define dagger - equip head:air - take item:<[dagger]> from: - give <[dagger].with_flag[throwing_skill_stuck:!]> to: ## This event removes the "stuck" flag from the item if the struck enemy removes it from their own head (can be removed if not using the "stuck" function): on player unequips armor: - if : - flag throwing_skill_stuck:! # This event determines the overall outcome of throwing the item: on entity damaged by snowball: - define projectile - if : # This line determines the original damage value on-hit: - determine passively # This line fires if it's a headshot AND the target is wearing a helmet: - if >= && <= && && : - playeffect effect:CRIT quantity:5 offset:0.3 data:0.4 - narrate target: "<&f><&l>Headshot! <&a>(2x damage)" - drop <[projectile]> - determine # This line fires if it's a headshot and the target IS NOT wearing a helmet: - else if >= && <= : - playeffect effect:CRIT quantity:5 offset:0.3 data:0.4 - narrate target: "<&f><&l>Headshot! <&a>(3x damage)" ## >READ ME: If you want the item to get stuck when a headshot occurs, replace the below line with "- equip head:<[projectile].with_flag[throwing_skill_stuck]>" - drop <[projectile]> - determine # This line fires if the target is blocking: - else if : - drop <[projectile]> - determine # This line fires in any other case: - else: - drop <[projectile]> - determine # This event drops the item if no entity is hit: on projectile hits block: - if : - drop # This event drops the item if an entity dies with it equipped to the head slot: on entity dies: - if : - drop