Skip to content

[Mineflayer with Python] bot.modes is NoneType and can't read isOn #3638

Open
@aeromechanic000

Description

@aeromechanic000
  • [v] The FAQ doesn't contain a resolution to my issue

Versions

  • mineflayer: 10.8.2
  • node: 18.20.5

Detailed description of a problem

When call bot.modes.isOn(), sometimes it raised an exception saying can't read isOn of NoneType.

Your current code

if bot.modes.isOn('cheat')  :
    ...

Expected behavior

I am not sure if it is normal for bot.modes to be None in some cases. If this is not a normal case, I think we should always be able to call bot.modes.isOn wihout checking if bot.modes is None.

BTW, bot.entity and player.entity sometimes returns None as well, I believe these behaviors are not expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stage1just created by someone new to the project, we don't know yet if it deserves an implementation / a fpossible bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions