Skip to content

[Bug]: “onPlayerInteractEntity”事件使用玩家API报错 #231

@sadwaw

Description

@sadwaw

Describe the bug

在“onPlayerInteractEntity”事件中使用 player.getHand()player.tell("1") 时发生报错。其他 API 暂未测试。

To Reproduce

  1. 监听“onPlayerInteractEntity”事件
  2. 在回调函数中调用 player.getHand()player.tell("1")
  3. 右键点击生物
  4. 终端出现报错

示例代码:
mc.listen("onPlayerInteractEntity",(player, entity, pos) => { let item = player.getHand() log(item.type) })

Expected behavior

在终端输出玩家主手物品的标准类型名。

Screenshots

Image

Platform

window10

BDS Version

1.21.50.10

LeviLamina Version

LeviLamina-1.0.1

LegacyScriptEngine Version

legacy-script-engine-quickjs v0.9.5

Additional context

17:13:37.565 ERROR [legacy-script-engine-quickjs] CallEvent Callback Failed!
17:13:37.565 ERROR [legacy-script-engine-quickjs] C++ Exception: script::Exception, from :
17:13:37.565 ERROR [legacy-script-engine-quickjs] not a function
17:13:37.565 ERROR [legacy-script-engine-quickjs] In Event: onPlayerInteractEntity
17:13:37.565 ERROR [legacy-script-engine-quickjs] In Plugin: GearMaster

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions