Sniffer Ji
📎 1 file 4,733 chars
📄
pasted-code-1789468321380.txt
txt 155 lines
▶
# Made By SnifferX2
# -------------------
# 1.21+



# ITEMS And Commands


on load:
	set {-weaving.mace} to mace named "&fWeaving Mace" with lore "&4Passive" and "&7- &c No Passive " and " " and "&f&lPowers:" and "&7- &f&lRemoves All Webs In Radius(4)" with custom model data 1
	set {-melee.mace} to mace named "&4&lMelee Mace" with lore "&4Passive" and "&7-&c Strength 1" and "&7-&c 1.5X Damage" and " " and "&f&lPowers:" and "&4No Powers" with custom model data 2
	set {-wings-mace} to mace named "&f&lWingsMace" with lore "&4Passive" and "&c No Passive" and " "  and "&f&lPowers:" and "&7-&f Flight" with custom model data 3
	broadcast "&a Loaded Sucessfully!"

command /mace :
	permission: op
	trigger:
		if arg-1 is set:
			if arg-1 is "Weaving":
				give 1 of {-weaving.mace} to player
			if arg-1 is "Melee":
				give 1 of {-melee.mace} to player
			if arg-1 is "Wings":
				give 1 of  {-wings-mace} to player



command /cooldown []:
	permission: op
	trigger:
		if arg-1 is set:
			set {_1} to arg-1
			cooldown({_1})
		else:
			set {_1} to player
			cooldown({_1})


on tab complete for "/cooldown":
	set tab completions for position 1 to all players

on tab complete for "/mace":
	set tab completions for position 1 to "Weaving" and "Melee" and "Wings"



every 1 second:
	loop all players:
		cooldownsystem(loop-player)
		actionbar(loop-player)


# Item's Use

on damage:
	loop all items in attacker's inventory:
		if IsMace(loop-item) is true:
			if WhatMace(loop-item) is "melee":
				add damage / 2 to damage


on right click:
	if IsMace(player's held item) is true:
		if WhatMace(player's held item) is "weaving":
			if {-weaving::%player's uuid%} is not "&aReady!":
				send "&cYour mace is on cooldown for %{-weaving::%player's uuid%}% Seconds" to player
			else:
				set {-weaving::%player's uuid%} to 45
				loop all blocks in radius 5 around player:
					if loop-block is cobweb:
						set {_loc} to loop-block's location
						set block at location at {_loc} to air
						Weaving(0.5, {_loc})
		else if WhatMace(player's held item) is "wings":
			if {-wings::%player's uuid%} is not "&aReady!":
				send "&cYour mace is in cooldown for %{-wings::%player's uuid%}% Seconds" to player
			else:
				set {flying::%player's uuid%} to true
				set {-wings::%player's uuid%} to "&cActive.."
				push player up at speed 2.5
				push player forward at speed 1
				wait 1 second
				while {flying::%player's uuid%} is set:
					if block below player is air:
						set {-wings::%player's uuid%} to "&cActive..."
						set gliding of player to true
						draw 2 of cloud at player with extra 0
						wait 1 tick
					else:
						set {-wings::%player's uuid%} to 45
						delete {flying::%player's uuid%}

on join:
	cooldown(player)

# Functions [Only For Devs]

function IsMace(i: item) :: boolean:
	if lore of {_i} contains "&7- &f&lRemoves All Webs In Radius(4)" or "&7-&c Strength 1" or "&7-&f Flight":
		return true

function WhatMace(i: item) :: string:
	if name of {_i} contains "&fWeaving Mace":
		return "weaving"
	if name of {_i} contains "&4&lMelee Mace":
		return "melee"
	if name of {_i} contains "&f&lWingsMace":
		return "wings"



function actionbar(p: player):
	set {_uuid} to {_p}'s uuid
	if IsMace({_p}'s held item) is true:
		if WhatMace({_p}'s held item) is "weaving":
			send action bar "&7---&bᴡᴇᴀᴠɪɴɢ &f| %{-weaving::%{_uuid}%}%&7---" to {_p}
		if WhatMace({_p}'s held item) is "wings":
			send action bar "&7---&bᴡɪɴɢꜱ &f| %{-wings::%{_uuid}%}%&7---" to {_p}




function cooldownsystem(p: player):
	set {_uuid} to {_p}'s uuid
	if {-weaving::%{_uuid}%} is not set:
		set {-weaving::%{_uuid}%} to "&aReady!"
	if {-wings::%{_uuid}%} is not set:
		set {-wings::%{_uuid}%} to "&aReady!"
	if {-weaving::%{_uuid}%} is 0:
		set {-weaving::%{_uuid}%} to "&aReady!"
	if {-weaving::%{_uuid}%} > 0:
		remove 1 from {-weaving::%{_uuid}%}
	if {-wings::%{_uuid}%} is 0:
		set {-wings::%{_uuid}%} to "&aReady!"
	if {-wings::%{_uuid}%} > 0:
		remove 1 from {-wings::%{_uuid}%}

function cooldown(p: player):
	set {_uuid} to {_p}'s uuid
	set {-weaving::%{_uuid}%} to "&aReady!"
	set {-wings::%{_uuid}%} to "&aReady!"

function Weaving(s: number, p: location):
	set {_spacing} to 0.1
	set {_pl} to location of {_p}
	set {_circumference} to 2 * pi * {_s}
	
	set {_numParticles} to floor({_circumference} / {_spacing})

	loop {_numParticles} times:
		set {_angle} to loop-value * 360 / {_numParticles}
		set {_v} to spherical vector with radius {_s}, yaw {_angle} and pitch 0
		
		make 1 of dust using dustOption(rgb(241, 210, 227), 2) at {_pl} ~ {_v}
Kodari AI
KodariSep 15 at 10:38 am 1
MaceMastery
MaceMastery is a Minecraft Skript plugin (1.21+) that introduces three unique maces with distinct abilities. The Weaving Mace removes all cobwebs in a 5-block radius with a particle effect and a 45-second cooldown. The Melee Mace passively adds 50% bonus damage on attack. The Wings Mace grants temporary flight with gliding and cloud particles until landing. Each mace features a per-player cooldown system with action bar status displays, admin commands for granting maces, and tab completion support. The plugin includes functions for mace identification, cooldown management, and particle rendering.
Kodari can make mistakes. Review important code before using.
Files
maces.sk
Code
1 164
maces.sk
Place this file in plugins/Skript/scripts/
# Requires Skript and an addon supporting custom model data, vectors, and dust particles.
# Reload with: /sk reload maces

options:
    prefix: &6[Maces]&r

on load:
    set {mace::item::weaving} to mace named "&fWeaving Mace" with lore "&4Passive" and "&7- &cNo Passive" and " " and "&f&lPowers:" and "&7- &f&lRemoves All Webs In Radius(5)" with custom model data 1
    set {mace::item::melee} to mace named "&4&lMelee Mace" with lore "&4Passive" and "&7- &cStrength 1" and "&7- &c1.5x Damage" and " " and "&f&lPowers:" and "&4No Powers" with custom model data 2
    set {mace::item::wings} to mace named "&f&lWingsMace" with lore "&4Passive" and "&cNo Passive" and " " and "&f&lPowers:" and "&7- &fFlight" with custom model data 3
    send "{@prefix} &aLoaded successfully!" to console

command /mace <text>:
    permission: op
    executable by: players
    trigger:# Mace abilities script
# 
        if arg-1 is "Weaving":
            give 1 of {mace::item::weaving} to player
        else if arg-1 is "Melee":
            give 1 of {mace::item::melee} to player
        else if arg-1 is "Wings":
            give 1 of {mace::item::wings} to player
        else:
            send "{@prefix} &cUsage: /mace <Weaving|Melee|Wings>" to player

command /cooldown [<player>]:
    permission: op
    trigger:
        if arg-1 is set:
            resetMaceCooldowns(arg-1)
            send "{@prefix} &aCooldowns reset for &e%arg-1%&a." to sender
        else:
            if sender is console:
                send "{@prefix} &cUsage: /cooldown [player]" to sender
                stop
            resetMaceCooldowns(player)
            send "{@prefix} &aYour mace cooldowns have been reset." to player

on tab complete for "/cooldown":
    set tab completions for position 1 to all players

on tab complete for "/mace":
    set tab completions for position 1 to "Weaving" and "Melee" and "Wings"

every 1 second:
    loop all players:
        updateMaceCooldowns(loop-player)
        showMaceActionbar(loop-player)

every 1 tick:
    loop all players:
        if {mace::flying::%loop-player's uuid%} is set:
            if block below loop-player is air:
                set gliding of loop-player to true
                draw 2 of cloud at loop-player with extra 0
            else:
                set gliding of loop-player to false
                set {mace::cooldown::wings::%loop-player's uuid%} to 45
                delete {mace::flying::%loop-player's uuid%}

on join:
    initializeMaceCooldowns(player)

on quit:
    delete {mace::flying::%player's uuid%}

on damage:
    if attacker is a player:
        if maceType(attacker's held item) is "melee":
            set damage to damage * 1.5

on right click:
    if isMace(player's held item) is true:
        initializeMaceCooldowns(player)

        if maceType(player's held item) is "weaving":
            if {mace::cooldown::weaving::%player's uuid%} is not "&aReady!":
                send "&cYour weaving mace is on cooldown for %{mace::cooldown::weaving::%player's uuid%}% seconds." to player
            else:
                set {mace::cooldown::weaving::%player's uuid%} to 45
                loop all blocks in radius 5 around player:
                    if loop-block is cobweb:
                        set {_location} to location of loop-block
                        set block at loop-block to air
                        weavingParticles(0.5, {_location})

        else if maceType(player's held item) is "wings":
            if {mace::cooldown::wings::%player's uuid%} is not "&aReady!":
                send "&cYour wings mace is on cooldown for %{mace::cooldown::wings::%player's uuid%}% seconds." to player
            else:
                set {mace::flying::%player's uuid%} to true
                set {mace::cooldown::wings::%player's uuid%} to "&cActive.."
                push player up at speed 2.5
                push player forward at speed 1

function isMace(i: item) :: boolean:
    if {_i} is air:
        return false

    if lore of {_i} contains "&7- &f&lRemoves All Webs In Radius(5)":
        return true
    if lore of {_i} contains "&7- &cStrength 1":
        return true
    if lore of {_i} contains "&7- &f Flight":
        return true

    return false

function maceType(i: item) :: string:
    if {_i} is air:
        return "none"

    if name of {_i} contains "&fWeaving Mace":
        return "weaving"
    if name of {_i} contains "&4&lMelee Mace":
        return "melee"
    if name of {_i} contains "&f&lWingsMace":
        return "wings"

    return "none"

function initializeMaceCooldowns(p: player):
    if {mace::cooldown::weaving::%{_p}'s uuid%} is not set:
        set {mace::cooldown::weaving::%{_p}'s uuid%} to "&aReady!"
    if {mace::cooldown::wings::%{_p}'s uuid%} is not set:
        set {mace::cooldown::wings::%{_p}'s uuid%} to "&aReady!"

function resetMaceCooldowns(p: player):
    set {mace::cooldown::weaving::%{_p}'s uuid%} to "&aReady!"
    set {mace::cooldown::wings::%{_p}'s uuid%} to "&aReady!"

function updateMaceCooldowns(p: player):
    initializeMaceCooldowns({_p})

    set {_weavingCooldown} to {mace::cooldown::weaving::%{_p}'s uuid%}
    if {_weavingCooldown} is a number:
        remove 1 from {mace::cooldown::weaving::%{_p}'s uuid%}
        if {mace::cooldown::weaving::%{_p}'s uuid%} is less than or equal to 0:
            set {mace::cooldown::weaving::%{_p}'s uuid%} to "&aReady!"

    set {_wingsCooldown} to {mace::cooldown::wings::%{_p}'s uuid%}
    if {_wingsCooldown} is a number:
        remove 1 from {mace::cooldown::wings::%{_p}'s uuid%}
        if {mace::cooldown::wings::%{_p}'s uuid%} is less than or equal to 0:
            set {mace::cooldown::wings::%{_p}'s uuid%} to "&aReady!"

function showMaceActionbar(p: player):
    if isMace({_p}'s held item) is true:
        if maceType({_p}'s held item) is "weaving":
            send action bar "&7--- &bᴡᴇᴀᴠɪɴɢ &f| %{mace::cooldown::weaving::%{_p}'s uuid%}% &7---" to {_p}
        else if maceType({_p}'s held item) is "wings":
            send action bar "&7--- &bᴡɪɴɢꜱ &f| %{mace::cooldown::wings::%{_p}'s uuid%}% &7---" to {_p}

function weavingParticles(s: number, p: location):
    set {_spacing} to 0.1
    set {_circumference} to 2 * pi * {_s}
    set {_particleCount} to floor({_circumference} / {_spacing})

    loop {_particleCount} times:
        set {_angle} to loop-value * 360 / {_particleCount}
        set {_vector} to spherical vector with radius {_s}, yaw {_angle} and pitch 0
        make 1 of dust using dustOption(rgb(241, 210, 227), 2) at {_p} ~ {_vector}