개인 자료란 (JE)

  서버 커뮤니티

Profile 눙이 대표칭호 없음

NUngiboy 6e95e864e48245c2afe38069f3b5551f

Profile

질문하기 스크립트

스크립트 실행시 서버가 멈춥니다

2022.01.10 조회 수 386 추천 수 0
이해도 초보자(스크립트 구성요소나 기본문법은 알아요) 
게임버전 (JE) 1.17.1 
게임버전 (BE) 관련없음 
스크립트 버전 2.6 
스크립트 애드온 SkBee, skRayFall,SkQuery 

서버 에러 (다음 코드가 반복됩니다)

[13:49:20] [Paper Watchdog Thread/ERROR]: --- DO NOT REPORT THIS TO PAPER - THIS IS NOT A BUG OR A CRASH  - git-Paper-408 (MC: 1.17.1) ---
[13:49:20] [Paper Watchdog Thread/ERROR]: The server has not responded for 10 seconds! Creating thread dump
[13:49:20] [Paper Watchdog Thread/ERROR]: ------------------------------
[13:49:20] [Paper Watchdog Thread/ERROR]: Server thread dump (Look for plugins here before reporting to Paper!):
[13:49:20] [Paper Watchdog Thread/ERROR]: ------------------------------
[13:49:20] [Paper Watchdog Thread/ERROR]: Current Thread: Server thread
[13:49:20] [Paper Watchdog Thread/ERROR]:     PID: 27 | Suspended: false | Native: false | State: RUNNABLE
[13:49:20] [Paper Watchdog Thread/ERROR]:     Stack:
[13:49:20] [Paper Watchdog Thread/ERROR]:         Skript.jar//ch.njol.skript.lang.Variable.getRaw(Variable.java:275)
[13:49:20] [Paper Watchdog Thread/ERROR]:         Skript.jar//ch.njol.skript.lang.Variable.get(Variable.java:287)
[13:49:20] [Paper Watchdog Thread/ERROR]:         Skript.jar//ch.njol.skript.lang.Variable.getConverted(Variable.java:432)
[13:49:20] [Paper Watchdog Thread/ERROR]:         Skript.jar//ch.njol.skript.lang.Variable.getSingle(Variable.java:641)
[13:49:20] [Paper Watchdog Thread/ERROR]:         Skript.jar//ch.njol.skript.expressions.ExprRandomNumber.get(ExprRandomNumber.java:73)
[13:49:20] [Paper Watchdog Thread/ERROR]:         Skript.jar//ch.njol.skript.expressions.ExprRandomNumber.get(ExprRandomNumber.java:41)
[13:49:20] [Paper Watchdog Thread/ERROR]:         Skript.jar//ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:99)
[13:49:20] [Paper Watchdog Thread/ERROR]:         Skript.jar//ch.njol.skript.effects.EffChange.execute(EffChange.java:273)
[13:49:20] [Paper Watchdog Thread/ERROR]:         Skript.jar//ch.njol.skript.lang.Effect.run(Effect.java:51)
[13:49:20] [Paper Watchdog Thread/ERROR]:         Skript.jar//ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:60)
[13:49:20] [Paper Watchdog Thread/ERROR]:         Skript.jar//ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:88)
[13:49:20] [Paper Watchdog Thread/ERROR]:         Skript.jar//ch.njol.skript.effects.Delay$1.run(Delay.java:109)
[13:49:20] [Paper Watchdog Thread/ERROR]:         app//org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftTask.run(CraftTask.java:101)
[13:49:20] [Paper Watchdog Thread/ERROR]:         app//org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:483)
[13:49:20] [Paper Watchdog Thread/ERROR]:         app//net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:490)
[13:49:20] [Paper Watchdog Thread/ERROR]:         app//net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1483)
[13:49:20] [Paper Watchdog Thread/ERROR]:         app//net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1282)
[13:49:20] [Paper Watchdog Thread/ERROR]:         app//net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319)
[13:49:20] [Paper Watchdog Thread/ERROR]:         app//net.minecraft.server.MinecraftServer$$Lambda$3681/0x00000008013de000.run(Unknown Source)
[13:49:20] [Paper Watchdog Thread/ERROR]:         [email protected]/java.lang.Thread.run(Thread.java:833)
[13:49:20] [Paper Watchdog Thread/ERROR]: ------------------------------
[13:49:20] [Paper Watchdog Thread/ERROR]: --- DO NOT REPORT THIS TO PAPER - THIS IS NOT A BUG OR A CRASH ---
[13:49:20] [Paper Watchdog Thread/ERROR]: ------------------------------

실행할 때 스크립트 코드

on damage:
    if attacker is player:
        if {skill.%attacker%.sword3.use} > 0:
            cancel event
            set {skill.%attacker%.sword3.use} to 0
            set {skill.%attacker%.sword3.aura} to 3
            set {skill.%attacker%.sword3.cooldown} to 90
            set victim's walk speed to 0
            set {_loc1} to victim's location
            set {_world} to attacker's world
            wait 0.05 second
            loop blocks in radius 2 of location of victim:
                set {_block.loc} to location of loop-value
                add {_block.loc} to {_blockLoc::*}
                set {_block} to block data of loop-value
                set {_block} to "%{_block}%"
                set {_data1::*} to {_block} split by "["
                add fixindex({_data1::1}) to {_blockLoc1::*}
            wait 0.05 second
            set {_size} to 0
            loop {_blockLoc1::*}:
                add 1 to {_size}
            set {_count} to 1
            while {_count} <= 10:
                set {_int} to random integer between 1 and {_size}
                if {_blockLoc1::%{_int}%} is "air" or "caveair" or "water":
                    if {_number::*} does not contain {_int}:
                        add {_int} to {_number::*}
                        set {_location.fix} to location 1 down {_blockLoc::%{_int}%}
                        add {_location.fix} to {_s.location::*} 
                        add 1 to {_count}
            wait 0.05 second
            set {_location0} to {_s.location::1}
            set {_location0} to "%{_location0}%"
            replace all ":" , "x","y","z"," " with "" in {_location0}
            set {_location0::*} to {_location0} split by ","
            loop {_location0::*}:
                set {_location0::%loop-index%} to {_location0::%loop-index%} parsed as number
            set {_vector0} to vector between {_s.location::1} and {_loc1}
            set {_vector0} to "%{_vector0}%"
            replace all ":" , "x","y","z"," " with "" in {_vector0}
            set {_vector0::*} to {_vector0} split by ","
            loop {_vector0::*}:
                set {_vector0::%loop-index%} to {_vector0::%loop-index%} parsed as number
            set {_yaw0} to facingyaw({_vector0::1}, {_vector0::3})
            set {_pitch0} to fixFitchVectorToAngle({_vector0::1}, {_vector0::2}, {_vector0::3})
            play sound "entity.firework_rocket.shoot" with volume 0.5 and pitch 3 to attacker
            teleport the attacker to location({_location0::1},{_location0::2},{_location0::3},{_world},{_yaw0},{_pitch0})
            push the attacker upward at speed 0.15
            damage victim by 15
            wait 0.2 second
            loop {_s.location::*}:
                set {_index} to loop-index
                set {_index} to {_index} parsed as integer
                if {_index} < 10:
                    set {_location} to {_s.location::%{_index}+1%}
                    set {_location} to "%{_location}%"
                    replace all ":" , "x","y","z"," " with "" in {_location}
                    set {_location::*} to {_location} split by ","
                    loop {_location::*}:
                        set {_location::%loop-index-2%} to {_location::%loop-index-2%} parsed as number
                    set {_vector} to vector between {_s.location::%{_index}+1%} and {_loc1}
                    set {_vector} to "%{_vector}%"
                    replace all ":" , "x","y","z"," " with "" in {_vector}
                    set {_vector::*} to {_vector} split by ","
                    loop {_vector::*}:
                        set {_vector::%loop-index-2%} to {_vector::%loop-index-2%} parsed as number
                    set {_yaw} to facingyaw({_vector::1}, {_vector::3})
                    set {_pitch} to fixFitchVectorToAngle({_vector::1}, {_vector::2}, {_vector::3})
                    play sound "entity.firework_rocket.shoot" with volume 0.5 and pitch 3 to attacker
                    teleport the attacker to location({_location::1},{_location::2},{_location::3},{_world},{_yaw},{_pitch})
                    push the attacker upward at speed 0.15
                    damage victim by 15
                    wait 0.2 second
            play sound "entity.firework_rocket.shoot" with volume 0.5 and pitch 3 to attacker
            teleport attacker to {_loc0}
            push the attacker upward at speed 0.15
            set attacker's walk speed to 0.2
            set victim's walk speed to 0.2
            damage victim by 30


종속되는 Function 스크립트

function facingyaw(x:number, z:number) :: number:
    set {_yaw} to -1*atan2({_z},{_x})
    return {_yaw}
function fixFitchVectorToAngle(x:number, y:number, z:number) :: number:
    set {_tan.line} to ({_y}/(sqrt({_x}^2+{_z}^2)))
    set {_pitch} to -1*atan({_tan.line})
    return {_pitch}


서버 설정

java -Xmx6G -jar paper-1.17.1-408.jar

문제 상황

위의 스크립트를 실행할 시 서버 에러 코드가 발생하고 에러 코드는 무한 반복하며, 접속한 서버는 Timed out으로 튕기게 됩니다

따라서 강제 종료를 하지 않으면 정상적인 진행이 되지 않습니다


어디가 오류인지 잘 모르겠어서 도움을 청합니다 ㅠㅠ





2개의 댓글

서재형
2022.01.10

저 에러는 서버가 무한 루프에 빠지거나, 무한 루프로 판단될정도로 오래 멈추면 일어나는 에러입니다. 스크립트 한 줄의 길이를 최대한 줄이고, 파일 수도 줄여보세요.

눙이
2022.01.10
@서재형

무한 루프라는 답변을 보고 while 문에서의 무한반복 현상을 찾았습니다! 감사합니다!