Skip to content

EscWhenDmg module#612

Open
tonyisher wants to merge 1 commit into
flarialmc:mainfrom
tonyisher:EscWhenDmg
Open

EscWhenDmg module#612
tonyisher wants to merge 1 commit into
flarialmc:mainfrom
tonyisher:EscWhenDmg

Conversation

@tonyisher
Copy link
Copy Markdown

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
Copy Markdown
Member

aint this already a thing in vanilla bedrock?

@AnhNguyenlost13
Copy link
Copy Markdown
Contributor

only chat screen I think
The code is weird tho

@tonyisher
Copy link
Copy Markdown
Author

aint this already a thing in vanilla bedrock?

really? is there a setting for it or smth?

@Aetopia
Copy link
Copy Markdown
Member

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