Files
mazeheart.sk
Code
1 176
mazeheart.sk
options:
cmd_data: 10001
name: "<#b87333>&lᴍ<#a37c45>&lᴀ<#8e8557>&lᴢ<#798e69>&lᴇ<#64977b>&lʜ<#4fa08d>&lᴇ<#3aa99f>&lᴀ<#25b2b1>&lʀ<#10bbc3>&lᴛ"
import:
org.bukkit.FluidCollisionMode
org.bukkit.Particle
org.bukkit.Particle$DustOptions
org.bukkit.Color
org.bukkit.util.Vector
command /givemazeheart [<player>]:
permission: op
trigger:
set {_p} to arg-1 ? player
set {_mace} to a mace named {@name}
set custom model data of {_mace} to {@cmd_data}
enchant {_mace} with wind burst 2
enchant {_mace} with density 5
give {_mace} to {_p}
on damage:
attacker is a player
damage cause is attack
type of attacker's tool is mace
custom model data of attacker's tool is {@cmd_data}
if event is cancelled:
stop
set {_p} to attacker
set {_impact} to victim's location
set {_ground} to {_p}.getWorld().rayTraceBlocks({_p}.getLocation(), new Vector(0, -1, 0), 1.5, FluidCollisionMode.NEVER, true)
if {_ground} is set:
set {_crack} to true
set {_center} to {_ground}.getHitPosition().toLocation({_p}.getWorld())
add 0.08 to y-coord of {_center}
mazeheartCracks({_center})
if {mazeheart::buff::%uuid of {_p}%} is true:
play sound "block.end_portal.frame.fill" with volume 0.4 and pitch 1.8 at {_p} for {_p}
play sound "block.anvil.land" with volume 0.2 and pitch 1.9 at {_p} for {_p}
if {_crack} is not true:
make 2 of electric spark at {_impact}
mazeheartWave({_impact}, 4.5, {_p})
stop
if victim is not a living entity:
if {_crack} is not true:
mazeheartWave({_impact}, 2.5, {_p})
stop
if victim is a player:
if {_crack} is not true:
mazeheartWave({_impact}, 2.5, {_p})
stop
if fall distance of {_p} <= 1.5:
if {_crack} is not true:
mazeheartWave({_impact}, 2.5, {_p})
stop
add 1 to {mazeheart::hits::%uuid of {_p}%}
set {_charge} to {mazeheart::hits::%uuid of {_p}%}
play sound "block.respawn_anchor.charge" with volume 1.0 and pitch 1.4 at {_p} for {_p}
if {_charge} is 1:
send action bar "<#b87333>◆ &8◆ ◆" to {_p}
if {_crack} is not true:
mazeheartWave({_impact}, 2.5, {_p})
stop
if {_charge} is 2:
send action bar "<#b87333>◆ <#798e69>◆ &8◆" to {_p}
if {_crack} is not true:
mazeheartWave({_impact}, 4.5, {_p})
stop
set {mazeheart::buff::%uuid of {_p}%} to true
enchant {_p}'s tool with density 10
enchant {_p}'s tool with breach 4
send action bar "<#b87333>◆ <#798e69>◆ <#4fa08d>◆" to {_p}
play sound "entity.warden.sonic_boom" with volume 1.2 and pitch 0.8 at {_p} for {_p}
play sound "item.trident.thunder" with volume 1.2 and pitch 0.7 at {_p} for {_p}
play sound "block.beacon.deactivate" with volume 1.5 and pitch 0.9 at {_impact} for all players
if {_crack} is not true:
mazeheartWave({_impact}, 7, {_p})
mazeheartBurst({_impact}, {_p})
wait 178 ticks
clear {mazeheart::buff::%uuid of {_p}%}
delete {mazeheart::hits::%uuid of {_p}%}
if {_p} is online:
if custom model data of {_p}'s tool is {@cmd_data}:
disenchant {_p}'s tool
enchant {_p}'s tool with density 5
enchant {_p}'s tool with wind burst 2
send action bar "&8◆ ◆ ◆" to {_p}
function mazeheartCracks(loc: location):
set {_world} to {_loc}.getWorld()
set {_green} to new DustOptions(Color.fromRGB(75, 145, 65), 0.65)
set {_copper} to new DustOptions(Color.fromRGB(184, 115, 51), 0.65)
set {_olive} to new DustOptions(Color.fromRGB(128, 128, 48), 0.65)
play sound "block.glass.break" with volume 1 and pitch 1.2 at {_loc} for all players
play sound "block.deepslate.break" with volume 1 and pitch 0.65 at {_loc} for all players
loop 7 times:
set {_angle::%loop-number%} to loop-number * 360 / 7 + random number between -12 and 12
set {_point::%loop-number%} to {_loc}.clone()
loop 6 times:
loop 7 times:
loop 2 times:
add random number between -18 and 18 to {_angle::%loop-number-2%}
add 0.14 * cos({_angle::%loop-number-2%}) to x-coord of {_point::%loop-number-2%}
add 0.14 * sin({_angle::%loop-number-2%}) to z-coord of {_point::%loop-number-2%}
if loop-number-2 mod 3 is 0:
{_world}.spawnParticle(Particle.DUST, {_point::%loop-number-2%}, 1, 0, 0, 0, 0, {_copper})
else if loop-number-2 mod 3 is 1:
{_world}.spawnParticle(Particle.DUST, {_point::%loop-number-2%}, 1, 0, 0, 0, 0, {_green})
else:
{_world}.spawnParticle(Particle.DUST, {_point::%loop-number-2%}, 1, 0, 0, 0, 0, {_olive})
if loop-number is 2:
play sound "block.copper.break" with volume 0.9 and pitch 1.3 at {_loc} for all players
if loop-number is 4:
play sound "block.glass.break" with volume 0.5 and pitch 1.7 at {_loc} for all players
wait 1 tick
function mazeheartWave(loc: location, maxRadius: number, p: player):
loop 10 times:
if {_p} is not online:
stop
set {_ground} to {_p}.getWorld().rayTraceBlocks({_p}.getLocation(), new Vector(0, -1, 0), 1.5, FluidCollisionMode.NEVER, true)
if {_ground} is set:
stop
set {_radius} to loop-number * {_maxRadius} / 10
loop 36 times:
set {_angle} to loop-number-2 * 10
set {_point} to {_loc}
add {_radius} * cos({_angle}) to x-coord of {_point}
add {_radius} * sin({_angle}) to z-coord of {_point}
add 0.1 to y-coord of {_point}
make 1 of cloud at {_point}
if loop-number-1 <= 7:
add 0.25 to y-coord of {_point}
make 1 of poof at {_point}
wait 1 tick
function mazeheartBurst(loc: location, p: player):
loop 6 times:
if {_p} is not online:
stop
set {_ground} to {_p}.getWorld().rayTraceBlocks({_p}.getLocation(), new Vector(0, -1, 0), 1.5, FluidCollisionMode.NEVER, true)
if {_ground} is set:
stop
loop 5 times:
set {_point} to {_loc}
add random number between -1.5 and 1.5 to x-coord of {_point}
add random number between 0.1 and 1.5 to y-coord of {_point}
add random number between -1.5 and 1.5 to z-coord of {_point}
make 1 of wax off at {_point}
make 1 of trial spawner detection at {_point}
wait 2 ticks
every 1 second:
loop all players:
if {mazeheart::buff::%uuid of loop-player%} is true:
send action bar "<#b87333>◆ <#798e69>◆ <#4fa08d>◆" to loop-player
else:
set {_charge} to {mazeheart::hits::%uuid of loop-player%}
if {_charge} is 1:
send action bar "<#b87333>◆ &8◆ ◆" to loop-player
else if {_charge} is 2:
send action bar "<#b87333>◆ <#798e69>◆ &8◆" to loop-player
on death of player:
attacker is a player
type of attacker's tool is mace
custom model data of attacker's tool is {@cmd_data}
play sound "entity.wither.death" with volume 1.0 and pitch 1.0 at victim's location for all players








