UltimateUI guide
How to change Block visibility based on a placeholder
In this guide, you will learn how to set Block Visibility based on Placeholder value
To change the visibility of an element based on the value returned by a placeholder, we need to perform the following steps:
Open the .yml file of our page, then find the element we want to configure and add a visibility section.
visibility:
visible: true
placeholder: "%player_health%=20"For example, this block will only be visible when the player's HP is 20.
The placeholder supports operators such as:
=- the placeholder value is equal to a number or text>=- the value is greater than or equal to<=- the value is less than or equal to
Additionally, we can define minimum, maximum, and default values:
placeholder: "%player_health,MIN=0,MAX=20,DEFAULT=20%=20"Now the minimum placeholder value will be 1, the maximum will be 20, and the default value (when the placeholder is not set) will be 10.