Server crashes after spawning monster.

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Dractical

Member
Dec 30, 2019
14
0
1
Skript Version (do not put latest):2.5-alpha6-MH
Skript Author:
Bensku
Minecraft Version: 1.16.3
Code:
Code:
on right click:
    if player's tool is a red dye named "&cBrimstone Jewel":
        if {activepet.%player%} is false:
            set {activepet.%player%} to false
            spawn a zombie at location of player
            add last spawned zombie to {pets.%player%.::*}
            add "{CustomNameVisible:1,Invulnerable:1,Invisible:1,IsBaby:1}" to nbt of last spawned zombie
            set the display name of the spawned zombie to "&cMini Amon"
            set {_amonitem} to "Cenyth" parsed as offlineplayer
            set helmet of last spawned zombie to skull of {_amonitem}
            set {_amonitem} to leather chestplate
            dye {_amonitem} (0, 0, 0)
            set chestplate of last spawned zombie to {_amonitem}
            set {_amonitem} to leather leggings
            dye {_amonitem} (0, 0, 0)
            set leggings of last spawned zombie to {_amonitem}
            set {_amonitem} to leather boots
            dye {_amonitem} (0, 0, 0)
            set boots of last spawned zombie to {_amonitem}
            apply invisibility 1 to the last spawned zombie for 999 days
            while spawned zombie is alive:
                if distance between player and spawned zombie is less than 10:
                    if distance between player and spawned zombie is bigger than 3:
                        make spawned zombie pathfind to location of player with speed 1.3
                else if distance between player and spawned zombie is bigger than 15:
                    teleport spawned zombie to position of player
            wait 1 tick
        else:
            send "&7[&bBeansPvP&7] &fYou already have an active pet." to player
command /removepets:
   trigger:
       if {activepet.%player%} is false:
           send "&7[&bBeansPvP&7] &fYou don't have an active pet." to player
       else:
           send "&7[&bBeansPvP&7] &fPet removed." to player
           kill all mobs in {pets.%player%.::*}
           set {activepet.%player%} to false

on disconnect:
   kill all mobs in {pets.%player%.::*}
   set {activepet.%player%} to false

No errors. It just spawns a normal zombie, and then the server crashes.
[doublepost=1602350551,1602306522][/doublepost]bump
[doublepost=1602438582][/doublepost]another bump
[doublepost=1602547935][/doublepost]b u m p
 
Not a solution but just to add information as i was trying to test it:
I definitely think It's your "while loop" that's causing it. Without that present it spawns just fine for me and doesn't crash.

With it present, it crashes like you say, but the zombie is properly spawned once the server loads back up(though it no longer counts as the spawned mob for the loop)
And the error code it produces on my end:
Code:
13.10 01:11:41 [Server] ERROR --- DO NOT REPORT THIS TO PAPER - THIS IS NOT A BUG OR A CRASH  - git-Paper-228 (MC: 1.16.3) ---
13.10 01:11:41 [Server] ERROR The server has not responded for 10 seconds! Creating thread dump
13.10 01:11:41 [Server] ERROR ------------------------------
13.10 01:11:41 [Server] ERROR Server thread dump (Look for plugins here before reporting to Paper!):
13.10 01:11:41 [Server] ERROR ------------------------------
13.10 01:11:41 [Server] ERROR Current Thread: Server thread
13.10 01:11:41 [Server] ERROR PID: 34 | Suspended: false | Native: false | State: RUNNABLE
13.10 01:11:41 [Server] ERROR Stack:
13.10 01:11:41 [Server] ERROR ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:101)
13.10 01:11:41 [Server] ERROR ch.njol.skript.lang.util.SimpleExpression.getSingle(SimpleExpression.java:59)
13.10 01:11:41 [Server] ERROR ch.njol.skript.lang.util.ConvertedExpression.getSingle(ConvertedExpression.java:158)
13.10 01:11:41 [Server] ERROR ch.njol.skript.expressions.ExprDistance.get(ExprDistance.java:65)
13.10 01:11:41 [Server] ERROR ch.njol.skript.expressions.ExprDistance.get(ExprDistance.java:1)
13.10 01:11:41 [Server] ERROR ch.njol.skript.lang.util.SimpleExpression.check(SimpleExpression.java:160)
13.10 01:11:41 [Server] ERROR ch.njol.skript.conditions.CondCompare.check(CondCompare.java:309)
13.10 01:11:41 [Server] ERROR ch.njol.skript.lang.Condition.run(Condition.java:56)
13.10 01:11:41 [Server] ERROR ch.njol.skript.lang.Conditional.walk(Conditional.java:51)
13.10 01:11:41 [Server] ERROR ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:89)
13.10 01:11:41 [Server] ERROR ch.njol.skript.lang.Trigger.execute(Trigger.java:57)
13.10 01:11:41 [Server] ERROR ch.njol.skript.SkriptEventHandler.check(SkriptEventHandler.java:154)
13.10 01:11:41 [Server] ERROR ch.njol.skript.SkriptEventHandler$1.execute(SkriptEventHandler.java:112)
13.10 01:11:41 [Server] ERROR app//co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80)
13.10 01:11:41 [Server] ERROR app//org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70)
13.10 01:11:41 [Server] ERROR app//org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:607)
13.10 01:11:41 [Server] ERROR app//org.bukkit.craftbukkit.v1_16_R2.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:503)
13.10 01:11:41 [Server] ERROR app//org.bukkit.craftbukkit.v1_16_R2.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:470)
13.10 01:11:41 [Server] ERROR app//org.bukkit.craftbukkit.v1_16_R2.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:466)
13.10 01:11:41 [Server] ERROR app//net.minecraft.server.v1_16_R2.PlayerConnection.a(PlayerConnection.java:1511)
13.10 01:11:41 [Server] ERROR app//net.minecraft.server.v1_16_R2.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:28)
13.10 01:11:41 [Server] ERROR app//net.minecraft.server.v1_16_R2.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:5)
13.10 01:11:41 [Server] ERROR app//net.minecraft.server.v1_16_R2.PlayerConnectionUtils.lambda$ensureMainThread$1(PlayerConnectionUtils.java:23)
13.10 01:11:41 [Server] ERROR app//net.minecraft.server.v1_16_R2.PlayerConnectionUtils$$Lambda$5569/0x00000008018be440.run(Unknown Source)
13.10 01:11:41 [Server] ERROR app//net.minecraft.server.v1_16_R2.TickTask.run(SourceFile:18)
13.10 01:11:41 [Server] ERROR app//net.minecraft.server.v1_16_R2.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136)
13.10 01:11:41 [Server] ERROR app//net.minecraft.server.v1_16_R2.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23)
13.10 01:11:41 [Server] ERROR app//net.minecraft.server.v1_16_R2.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109)
13.10 01:11:41 [Server] ERROR app//net.minecraft.server.v1_16_R2.MinecraftServer.ba(MinecraftServer.java:1135)
13.10 01:11:41 [Server] ERROR app//net.minecraft.server.v1_16_R2.MinecraftServer.executeNext(MinecraftServer.java:1128)
13.10 01:11:41 [Server] ERROR app//net.minecraft.server.v1_16_R2.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119)
13.10 01:11:41 [Server] ERROR app//net.minecraft.server.v1_16_R2.MinecraftServer.sleepForTick(MinecraftServer.java:1089)
13.10 01:11:41 [Server] ERROR app//net.minecraft.server.v1_16_R2.MinecraftServer.w(MinecraftServer.java:1003)
13.10 01:11:41 [Server] ERROR app//net.minecraft.server.v1_16_R2.MinecraftServer.lambda$a$0(MinecraftServer.java:177)
13.10 01:11:41 [Server] ERROR app//net.minecraft.server.v1_16_R2.MinecraftServer$$Lambda$3131/0x00000008008fe040.run(Unknown Source)
13.10 01:11:41 [Server] ERROR [email protected]/java.lang.Thread.run(Thread.java:834)
13.10 01:11:41 [Server] ERROR ------------------------------

Perhaps an issue with the latest version of skript and that kind of loop?
 
Same error for me, and I get the same results as you get. It crashes server, when I reboot the mob follows me. Either its working or its just because it is a zombie.
 
Status
Not open for further replies.