Skip to content

Instantly share code, notes, and snippets.

@Tschrock
Created February 2, 2020 02:22
Show Gist options
  • Save Tschrock/da0302c13db5a5e32df7c5b0a0e8a2d3 to your computer and use it in GitHub Desktop.
Save Tschrock/da0302c13db5a5e32df7c5b0a0e8a2d3 to your computer and use it in GitHub Desktop.
A collection of bugs, quirks , and workarounds I've found for Minecraft: Bedrock Edition's experimental UI.

Minecraft Bedrock - Hummingbird UI

The UI engine has a number of quirks, this file tries to document some of them.

Document/Body

  • The top of the screen gets cut off by about 4 pixels

Fonts

  • Fonts act a bit weird. Some elements will inherit the font-family of their parent, while others like buttons do not. Also, there doesn't seem to be a fallback font (or it's not working on my system) because anything without a font-family (or set to an invalid font-family) does not render text.

Border Images

  • The sprite used for the border image must be smaller than the element's rendered size (It must be able to tile itself at least once), otherwise part of the border gets cut off (See https://p.cp3.es/ss1579466973-1216.png vs https://p.cp3.es/ss1579467100-4d96.png)
  • The sprite can't be too small, otherwise it will cause a ton of lag when re-drawing (for ex, when resizing the screen). This lag is caused by excessive tiling and seems to increases exponentially with window size.

Inputs

  • All <input> types show a text input, except for type="button" which crashes the game.
  • An input's background-image and border-image disappears when it looses focus. The easiest way I've found to fix this is to turn it off and back on again. And by that I mean detaching and reattaching the element to the DOM using element.parentNode?.replaceChild(element, element);.

Javascript

  • For some objects Object.getPrototypeOf() throws an unexpected "Illegal invocation" exception
  • Node lists are not iterable (they don't have a Symbol.iterator), which means you can't use the spread operator on them. This means if you want to loop over or spread a Nodelist you need to turn itinto an array using Array.from(nodeList).
  • <Element>.style.* properties can not be unset.
  • Using <Element>.setAttribute() and related methods does not update styles using attribute selectors. This can be fixed by changing a class or reattaching the element to the DOM.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment