LiteLDev / LegacyScriptEngine

A plugin engine for running LLSE plugins on LeviLamina
https://lse.liteldev.com/
GNU General Public License v3.0
43 stars 8 forks source link

[Bug]: mc.explode();有一些问题 #111

Closed Ctrini closed 4 months ago

Ctrini commented 4 months ago

Describe the bug

mc.explode();不断运行

To Reproduce

mc.listen("onBlockExplode", (source,pos) => { let it = ''; log(source.type + " 1"); if (source.type === 'minecraft:air'){ mc.explode(pos.x, pos.y, pos.z, pos.dimid, it, 3, false, false); return false; } });

使用上述代码后。去下界或末地,点击床一次就会崩服

Expected behavior

[2024-04-28 15:48:49.029 INFO][a] minecraft:air 1

[2024-04-28 15:48:49.170 INFO][a] minecraft:air 1

[2024-04-28 15:48:49.170 INFO][a] minecraft:air 1

[2024-04-28 15:48:49.170 INFO][a] minecraft:air 1

[2024-04-28 15:48:49.170 INFO][a] minecraft:air 1

[2024-04-28 15:48:49.170 INFO][a] minecraft:air 1

[2024-04-28 15:48:49.279 INFO][a] minecraft:air 1

[2024-04-28 15:48:49.279 INFO][a] minecraft:air 1

[2024-04-28 15:48:49.279 INFO][a] minecraft:air 1

[2024-04-28 15:48:49.279 INFO][a] minecraft:air 1

[2024-04-28 15:48:49.279 INFO][a] minecraft:air 1

[2024-04-28 15:48:49.373 INFO][a] minecraft:air 1

[2024-04-28 15:48:49.373 INFO][a] minecraft:air 1

[2024-04-28 15:48:49.373 INFO][a] minecraft:air 1

[2024-04-28 15:48:49.373 INFO][a] minecraft:air 1

[2024-04-28 15:48:49.373 INFO][a] minecraft:air 1

......

Screenshots

No response

Platform

winserver2019

BDS Version

1.20.73

LeviLamina Version

0.11.1

LegacyScriptEngine Version

0.6.4

Additional context

No response

ShrBox commented 4 months ago

?

Ctrini commented 4 months ago

才发现我写的死循环。

mc.explode(pos,source,power,range,isDestroy,isFire) 这个api中的power无法使用

控制台信息:

16:34:17.836 ERROR [legacy-script-engine-quickjs] script::Exception: Wrong number of arguments! [failed to obtain stacktrace] 16:34:17.836 ERROR [legacy-script-engine-quickjs] In API: McClass::explode 16:34:17.836 ERROR [legacy-script-engine-quickjs] In Plugin: a

去掉power后正常

Ctrini commented 4 months ago

设置爆炸来源的实体对象貌似也无法使用