Skip to content

Conversation

@tonyisher
Copy link

New module: EscWhenDmg
Automatically "presses" the Esc key when the player takes damage while on some screens (currently works on chest, inventory, chat, and pause screen). Screens are configurable.

@EpiclyRaspberry
Copy link
Member

aint this already a thing in vanilla bedrock?

@AnhNguyenlost13
Copy link
Contributor

only chat screen I think
The code is weird tho

@tonyisher
Copy link
Author

aint this already a thing in vanilla bedrock?

really? is there a setting for it or smth?

@Aetopia
Copy link
Collaborator

Aetopia commented Feb 3, 2026

Why use a std::vector here?

std::vector<bool> screen_check = {
    getOps<bool>("chest") && currentScreen == "small_chest_screen",
    getOps<bool>("chest") && currentScreen == "large_chest_screen",
    getOps<bool>("chest") && currentScreen == "chest_screen", // just in case
    getOps<bool>("chat") && currentScreen == "chat_screen",
    getOps<bool>("pause") && currentScreen == "pause_screen",
    getOps<bool>("inventory") && currentScreen == "inventory_screen",
};

You would probably optimize this by:

  • Using std::array for fixed & statically sized containers.
  • Calling getOps<bool>("chest") once and caching it, avoiding potential lookup overhead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants