LTDV10Test/packet/kubejs/client_scripts/bug_fix.js
3944Realms 67a395b765
Some checks failed
Deploy to Remote Server / deploy (push) Failing after 1m11s
初始化
2026-04-14 18:20:56 +08:00

32 lines
854 B
JavaScript

BlockEvents.rightClicked("alexsmobs:capsid", e => {
const { block, player, level } = e
let mainHandItem = player.mainHandItem
let entityData = block.entityData
let entityId = entityData
&& entityData["Items"]
&& entityData["Items"][0]
&& entityData["Items"][0]["id"]
|| 'unknown';
if (
entityId == "create:minecart_contraption"
&& mainHandItem?.id == "create:minecart_contraption"
) {
e.cancel()
player.sendInventoryUpdate()
}
if (
entityId.search("present") != -1
&& mainHandItem?.id.search("present") != -1
) {
e.cancel()
player.sendInventoryUpdate()
}
if (
entityId.search("functionalstorage") != -1
&& mainHandItem?.id.search("functionalstorage") != -1
) {
e.cancel()
player.sendInventoryUpdate()
}
})