Skip to content

[Bug]: 对象未定义时操作玩家绑定数据会崩服 #299

Open

Description

@Ice-rink

Describe the bug

对象未定义时操作玩家绑定数据会崩服

To Reproduce

mc.listen("onSetArmor", (pl) => {
pl.setExtraData("test",1)
})

Expected behavior

会在控制台抛出错误,但并不会崩服

Screenshots

Image

Platform

Windows 10

BDS Version

1.21.80

LeviLamina Version

1.3.3

LegacyScriptEngine Version

0.12.0

Additional context

这个是导致崩溃的插件
如果要复现崩服,请把41行注释掉

QYServer.js.txt

Activity

  1. xiaoqch commented on Jul 4, 2025

    @xiaoqch
    Contributor

    onSetArmor事件回调函数的玩家参数有点问题,但是不应该undefined
    pl is not defined是不是你当时变量名写错了,按道理41行的判断应该是没效果的

  2. xiaoqch commented on Jul 5, 2025

    @xiaoqch
    Contributor

    事件参数的bug已修复,崩服与此bug无直接关系且无法复现

  3. xiaoqch commented on Jul 6, 2025

    @xiaoqch
    Contributor

    是不是在重载插件后崩服的,如果是的话那应该是和 #300 是同一个问题

  4. added theissue type on Jan 14, 2026
  5. removed
    bugSomething isn't working
    on Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions