Files
cobwebaxe.sk
Code
1 38
cobwebaxe.sk
# Cobweb Axe Script
# Author: Generated
# Version: 1.0
# Description: Special netherite axe that places cobwebs under hit players
options:
prefix: &6[CobwebAxe]&r
axe-name: &3&lCobweb Axe
permission: cobwebaxe.use
# Command to give the cobweb axe
command /caxe:
permission: {@permission}
permission message: &cYou don't have permission to use this command!
trigger:
# Create the special cobweb axe
give player 1 netherite axe named "{@axe-name}" with lore "&7Hit players to trap them in cobwebs!" and "&8Special Weapon"
send "{@prefix} &aYou have received the Cobweb Axe!" to player
# Event when player hits another player with the axe
on damage:
attacker is a player
victim is a player
attacker's tool is a netherite axe
# Check if the axe has the special name (identifies it as cobweb axe)
name of attacker's tool is "{@axe-name}"
# Get the location under the victim
set {_location} to location of victim
set y-coordinate of {_location} to y-coordinate of {_location} - 1
# Place cobweb at the victim's feet
set block at victim's location to cobweb
# Optional: Send feedback messages
send "{@prefix} &eYou trapped %victim% in a cobweb!" to attacker
send "{@prefix} &cYou've been trapped in a cobweb!" to victim