Custom Displays
By default, WIT provides a BossBar and an ActionBar to display information to the player. However, you can create entirely custom displays (such as titles, scoreboards, or chat messages) by extending the InfoDisplay class and registering it.
Creating a Custom Display
To create a custom display, you must extend InfoDisplay and provide a unique string ID in the constructor. You must then implement the methods that WIT calls when a player looks at a block or entity.
Here is an example of a custom display that sends a Title to the player's screen:
Registering the Display
Register your custom display during your addon's startup using API.addDisplay(). Remember to register this inside your onWITReload() method as well!
Players can now switch to your custom display in-game by typing /wit type title.
Default Displays
WIT ships with two built-in display types that handle the Info object, colors, and progress floats differently.
BossBar (bossbar)
Text: Renders the
getCombined()component (Prefix + Name + Suffix) as the title of the boss bar.Progress: Visually fills or depletes the boss bar.
Color: Maps standard Adventure
TextColorhexes to the closest vanillaBossBarColor(Red, Blue, Green, Yellow, Purple, White).
ActionBar (actionbar)
Text: Renders the
getCombined()component above the hotbar.Progress: Renders based on the player's
/wit progress <mode>setting.OFF: Hides progress entirely.PERCENT: Appends a percentage (e.g.,(75%)).BAR: Appends a miniature pipe bar (e.g.,[||||||| ]).UNDERLINE: Uses an underlined space trick to simulate a continuous bar.
Color: Applies the provided
TextColorto the appended progress UI.