Describe the bug
用不存在的物品类型名新建物品居然可以返回item类型而不是null,而后面获取it.maxDamage属性会直接崩服
意外发现的,不是什么大问题,用正确的物品类型名就好。
但这样直接崩服会让服主不好排查问题,捕获此异常可以提高LSE的稳定性
To Reproduce
const it = mc.newItem("minecraft:sdfsdf", 1);
log(it);
log(it.maxDamage);
Expected behavior
不存在的物品类型名新建物品时正确返回null或在lse层抛出错误
Screenshots
No response
Platform
No response
BDS Version
20.51
LeviLamina Version
26.51.5
LegacyScriptEngine Version
0.22.2
Additional context
No response
Describe the bug
用不存在的物品类型名新建物品居然可以返回item类型而不是null,而后面获取it.maxDamage属性会直接崩服
意外发现的,不是什么大问题,用正确的物品类型名就好。
但这样直接崩服会让服主不好排查问题,捕获此异常可以提高LSE的稳定性
To Reproduce
const it = mc.newItem("minecraft:sdfsdf", 1);
log(it);
log(it.maxDamage);
Expected behavior
不存在的物品类型名新建物品时正确返回null或在lse层抛出错误
Screenshots
No response
Platform
No response
BDS Version
20.51
LeviLamina Version
26.51.5
LegacyScriptEngine Version
0.22.2
Additional context
No response