"Advanced" is a strong word, the contents of this page was written to be understood by everyone, but it may not be useful to everyone therfore I deemed it "advanced".

Advanced hud


If statements and loops



The indentation must be of a consistent type or unexpected issues may occur. #for loops are only available in Hudder version 8.0.0 and above!
You can use #if to do large if conditions (unlike inline-conditions you can only have 1 condition without an else statement)

#while is similar except it repeats itself until the condition is false. You can also use {break} to stop the execution of the while loop early without stopping the execution of the rest of the hud.

Here is an example of both (Please do not use this, it will likely crash your game): #if fps<60 {math=10+20} {crashmypc=true} {xx=0} {yy=0} #while crashmypc #if yy>height {crashmypc=false} ;hand, xx,yy,1; {xx=xx+16} #if xx>width {yy=yy+16} {xx=0}
Magnificent, isn't it? Looks like I peaked early when I came up with this piece of art.

#for loops work in 2 different ways, it can either:
Loop from a specific number to another: #for num in range(0,10): ;alert, num; Which will send the user all the numbers between 0 (inclusive) and 10 (exclusive) in order.

Or it could loop through an array: #for i in ["I want", "to", 0x6B696C6C, "myself"]: ;alert, num; Which will send the user all the values in the array in order (from left to right).

{break} in a #for loop works in a similar way to #while.

Strings


Strings are pieces of text. Any variable surrounded by double quotes (ex. "String") will be considered a string.

You can use the '+' operator to combine strings, ex: "X: " + x will return a string that is "X: [the x position of the player]"

Strings also have plenty of functions in them that allow you to do all sorts of things, among those functions are:
Function Description
[String].charAt(Number) Returns the char at the specified index.
[String].contains(String) Returns true if and only if this string contains the specified sequence of char values.
[String].endsWith(String) If this string ends with the specified suffix.
[String].equalsIgnoreCase(String) Compares this String to another String, ignoring case considerations.
[String].length() Returns the length of this string.
[String].repeat(Number) Returns a string whose value is the concatenation of this string repeated requested amount of times.
[String].startsWith(String) Tests if this string starts with the specified prefix.
[String].substring(Number) Returns a string that is a substring of this string.
[String].substring(Number, Number) Returns a string that is a substring of this string.
[String].toCharArray() Converts this string to a new character array.
[String].toLowerCase() Returns a new string where all of the characters in this String are lower case.
[String].toUpperCase() Returns a new string where all of the characters in this String are upper case.
[String].trim() Returns a string whose value is this string, with all leading and trailing space removed.


Arrays


Arrays are available at Hudder version 5.5.0 or above! The first item in an array starts at 0! An array is a list of values with that can be of any length (up to infinity [aka how much your computer can handle]).

You can use [values,seperated,by,commas] to create an array that stores a list of values of any type.
To read the value at a certain spot in an array you must use arrayname[position].
To set a value at a certain point you must do arrayname[position]=value.
Arrays have a fixed size which can be read using the length function.
Arrays can be expanded be inserting a value after the last point in the array (You can't skip points, if an array is of length 6 and you wish to expand it, you must set a value at point 7, before you set a value at point 8)

here is a simple example: Define an array with 3 objects inside it (the number 4 and the number 2 and the word "Text"): {arr=[4,2,"Text"]} Get the number of objects within the array (3): {length(arr)} Replace the number 2 (at position 1) with the number 3: {arr[1]=3} Read the first value (at position 0) of the array: {arr[0]} Add an object in the 4th position of the array: {arr[3]="4th object"} Read the new length of the array (4): {length(arr)}

Creating your own methods/functions


You can use #def to write your own methods. here is an example: #def divide, num1, num2 {result = num1/num2} ;divide, 4, 2; {result}
You can also use {break} to stop the execution of the method early without stopping the execution of the rest of the hud.

if you add a ;return, [value];, it will become a function instead: #def divide, num1, num2 ;return, num1/num2; {divide(4,2)}

The Break variable


The {break} variable is special because it's not actually a variable, once it is used, execution of the hud will stop.

If used in #while loop or a #def method, then instead of stopping the execution of the hud it will just stop the execution of the while loop or def method. The above statement is only true for #while and #def, not #if. Example: #while _i<10 {_i++} #if _i==5 {break} {_i} Will set {_i} to 5

Inc, Dec and Boolean operators


You can use {_i++} to increase _i's value by 1 and then return the it's old value, {_i--} does the same but decreases by 1.

You can use {++_i} to increase _i's value by 1 and then return the it's new value, {--_i} does the same but decreases by 1.

You can use {!_i} to return the opposite value of _i, if it is true then it will return false, if it is false then it will return true.

You can use {boolean2&&boolean1} to return true if both booleans are true

You can use {boolean2||boolean1} to return true if either booleans are true

Item components

Works in JavaScript, the values are a property of the returned object.
The getItem([Number slot]) function returns an object that contains the following properties:
name - The name of the item item_name - The name of the item type (Even if name was modified with anvil/commands) repair_cost - The repair cost of the item damage - How much the item has been damaged max_damage - How much the item can bee damaged max_stack_size - The max stack size of the item enchantment_glint_override - Imma be honest idk what this one does, check the minecraft wiki if it's important. trim - An object containing the following 3 properties: - material - The name of the material used on the armor piece's trim - pattern - The name of the pattern used on the armor piece's trim - showintooltip - Whether it should show the armor trim in the item's tooltip (idk how this would be useful but it was easy to add so I added it.) enchantable - If not null, items with the component can be enchanted in an enchanting table. lore - An array of "Text" objects (use their getString function if you need a string) rarity - Can be of the following values: common, uncommon, rare and epic. unbreakable - If it is not null then the tool is unbreakable. custom_data - Custom NBT data attached to the object... in the form of a string. enchantments - Contains every enchantment on the object, if the enchantment is null then it is not present: - [Enchantment name] - The enchantment - level - The level of the enchantment on the item. Those properties can be navigated with the '.' character

Example: Your selected item has {getItem(selectedslot).durability} durability left!

;no_sys_var; and ;sys_var; methods


Probably broken, advised against using. By default if you tried to do {x=10} you'll get an error saying you can't modify system variables.
Or you might make a function/method where the names of one of the parameters is "x" or "y", at which point accessing the value becomes impossible since it will always return the x or y position of the player.

If you know how, you can use JavaScript to bypass the issue but if you wanna stick with Hudder you can use ;no_sys_var; (and it's inverse ;sys_var;)

;no_sys_var; will disable implicit access of system variables allowing you to define whatever variables you'd like and you'll always know the variables you are accessing are defined by you and not Hudder.

Of course, this also means you'll have to access system variables explicitly using the Variable reading functions.