Okay so im working on a gamemode and I need to check loop entities around the attacker, so here's my code:
if you look at the last lines of code, you can see that im checking for entities in radius 500 of the attacker, and if the loop entity isn't a magma cube, it should do the following things.
Now, this code simply dosent work, I dont get any errors in Skript but it dosent work properly.
What happens is it simply spams:
send "&c[BOSS] Extreme Magma Cube&f: &4ENOUGH! &fHow did you manage to kill all of my magma cubes? Well, nevermind, it's time you see true power." to attacker
spawn 1 slime at location of attacker
set slime size of last spawned slime to 15
set name of last spawned slime to "&4&lEXTREME MAGMA CUBE"
even if theres still magma cubes in radius 500 of the attacker, it will spam that no matter what.
Another weird thing is that I have an item called "Pickaxe Of The Dead" and it has an ability where when you right click, it kills all mobs in radius 10 of you. You know what happens? It only kills 1 mob even if theres still more mobs. Funny how it actually worked before but now all of a sudden it stopped working.
So can anyone help me? Thanks.
[doublepost=1617646768,1617646276][/doublepost]New Update: I made another skript where I made a command that loops entities in radius 10 of player, and if that loop entity is slime it will kill it.
Guess what? It worked with no problems, meaning the problem is because of my skript.
Code:
on damage:
if victim is magma cube:
set damage to 0
if attacker is in world "%attacker%":
remove 50 from {magmacubeadventurehealth::%uuid of attacker%}
if attacker's held item is {@magmablade}:
remove 300 from {magmacubeadventurehealth::%uuid of attacker%}
if attacker's held item is {@witherbow}:
remove 250 from {magmacubeadventurehealth::%uuid of attacker%}
if attacker's held item is {@magmablademythic}:
remove 400 from {magmacubeadventurehealth::%uuid of attacker%}
if attacker's held item is {@endersword}:
remove 200 from {magmacubeadventurehealth::%uuid of attacker%}
if attacker's held item is {@pickaxeofthedead}:
remove 500 from {magmacubeadventurehealth::%uuid of attacker%}
if {magmacubeadventurehealth::%uuid of attacker%} is less than 1:
kill victim
set {magmacubeadventurehealth::%uuid of attacker%} to 5000
loop all entities in radius 500 of attacker:
if loop-entity is not magma cube:
send "&c[BOSS] Extreme Magma Cube&f: &4ENOUGH! &fHow did you manage to kill all of my magma cubes? Well, nevermind, it's time you see true power." to attacker
spawn 1 slime at location of attacker
set slime size of last spawned slime to 15
set name of last spawned slime to "&4&lEXTREME MAGMA CUBE"
kill loop-entity
if you look at the last lines of code, you can see that im checking for entities in radius 500 of the attacker, and if the loop entity isn't a magma cube, it should do the following things.
Now, this code simply dosent work, I dont get any errors in Skript but it dosent work properly.
What happens is it simply spams:
send "&c[BOSS] Extreme Magma Cube&f: &4ENOUGH! &fHow did you manage to kill all of my magma cubes? Well, nevermind, it's time you see true power." to attacker
spawn 1 slime at location of attacker
set slime size of last spawned slime to 15
set name of last spawned slime to "&4&lEXTREME MAGMA CUBE"
even if theres still magma cubes in radius 500 of the attacker, it will spam that no matter what.
Another weird thing is that I have an item called "Pickaxe Of The Dead" and it has an ability where when you right click, it kills all mobs in radius 10 of you. You know what happens? It only kills 1 mob even if theres still more mobs. Funny how it actually worked before but now all of a sudden it stopped working.
So can anyone help me? Thanks.
[doublepost=1617646768,1617646276][/doublepost]New Update: I made another skript where I made a command that loops entities in radius 10 of player, and if that loop entity is slime it will kill it.
Guess what? It worked with no problems, meaning the problem is because of my skript.