A Guide to Housing Scripting (2024)

There is a lot more to Hypixel housing than meets the eye. You might come onto some houses and see that they're capable of doing a lot of things, including things that you thought were basic but you then realize you have no idea how they did that. Hypixel housing allows you to create your own games in Minecraft to a great of complexity. It may seem overwhelming at first, but I will break it down into various categories and key concepts so you can have a much better understanding of how to script your own house in Hypixel. And when I say "scripting," I don't mean typing at a computer in a programming language, though I suppose Hypixel housing is a kind of programming language, but the way you script in housing is through menus.

Stats
In housing, a stat is a virtual value. There are two kinds of stats: player stats, and global stats. Player stats are personal stats that have a history designated to each individual player, and global stats are universal stats that only have one history across the whole house, and can be affected by anyone if they are able to. You can create as many stats as you want, however there is not a section designated to creating stats and viewing all the stats that exist, but rather, if you are ever in a situation where you need to configure something that involves the usage of a stat, then you can go ahead and configure it, and where you input the stat, you just input the name of the stat. That's it. You can create stats at will just by referencing a stat name in a place where you might need to use it.
Another thing to note is that player stats reset after a certain amount of time. By default, the maximum value you can set this to is two weeks, where if you haven't joined after two weeks, all of your player stats will be reset. However, if you have Housing+ like I do, then it can go up to a year. This does not apply to global stats though.

Actions
These are things that something can do. They are accessed through various things that I will get into, and will do what the name suggests, with their own menu to configure how exactly it will it and what it will do in more specific terms.

Functions
Functions will do according to what actions have been put inside of it. You can put as many actions in it as you want, and that function will do all of those actions. You can also configure it to run constantly by right clicking it, and clicking "automatic execution," where you can select the number of ticks it must wait before it executes once more. From there, it will loop every X number of ticks.

Event Actions
Event actions are like functions, except they only execute when a specific thing happens. Whether that be a player kill, player death, fish catch, block break (which only activates when a player without build tries to break a block and fails), it will only activate if the event it is designated to occurs. And once it does occur, whatever actions you've configured within it will occur.

Pro Tools
This is Hypixel's version of WorldEdit. There are nine pro tools: region selection tool, set tool, fill tool, walls tool, wireframe tool, cut tool, copy tool, paste tool, and undo tool. Using the region selection tool, you first left click one block to set corner A, then right click a block to set corner B. From there, Hyipxel will virtually create a box whose size are defined by corners A and B, where those are its corners. It will create red particles that will appear for you, (but if you find those annoying, you can go to the housing lobby, clicking on your player head labeled "My Profile," going to the comparator labeled "Settings & Visibility," going to the dark oak door labeled "Personal Housing Settings," and clicking on the oak fence labeled "Pro Tools Particles." Some other quality of life features are in that same menu). From there, you can use the other pro tools to affect the specified region you have created.
When right clicking holding the set tool (or when doing //set [block ID), you will be brought with a menu, where you can click on an item from your inventory, and it will automatically fill the entire selected region with that block if it is valid. It will replace everything in the region.
When right clicking holding the fill tool (or when doing //fill [block ID]), it functions the exact same as the set tool, except it will not replace existing blocks, and will only fill the empty space. The game will also tell you if nothing has changed upon the execution of the set/fill tool. In both the set and fill scenarios, if you do //set, followed by multiple different block IDs, it will create a random distribution of those blocks, where the ratio of one block ID to the other will be how abundant each one is compared to the other. This is useful for creating ore distributions, among many other things.
When using the walls tool, (or doing //walls [block ID]), it will create a hollow box mapping out all of the edges of your region with whatever your selected block is.
When using the wireframe tool, (or doing //wireframe [block ID]), it functions just like the walls tool, except both the cube and the squares are hollow, leaving only a wireframe of a cube mapping out the corners and edges of your region with whatever your selected block is.
When using the cut tool, (or doing //cut), it will clear every block within your selected region.
When using the copy tool (or doing //copy), it will copy whatever is in your region, and store it for later.
When using the paste tool (or doing //paste), it will paste whatever you have saved from using the copy tool into your region.
And when using the undo tool (or doing //undo), it will reverse the last change you caused via pro tools.
That was a lot of pro tools, but they're pretty easy to understand just from the name, and if they're not, Hypixel provides their own explanation just by hovering over the item and looking at its subtitle.

Regions
The region selection tool isn't just useful for using the other pro tools to affect a particular area of your house to do things a lot faster, it can also be saved and do its own things. First, make a region using the region selection tool by selecting corner A and corner B. Then, do //region create [region name (can have spaces and everything)], and boom! You have you region! Go to your housing menu, click on the activator rail labeled "Systems," click on the grass block labeled "Regions," and there you will see the catalog of regions you have created and labeled into the catalog. From there, you can click on it, and make it do things. You can modify its PvP settings, such that those PvP settings will apply when a player is within that region, and not apply when they are not within that region. You can also create entry actions and exit actions, actions that will activate when the player enters the region, and actions that will activate when the player exits the region. Regions are completely invisible, so you can do things seamlessly.

Custom Menus
You can also create your own custom menus. You can adjust the number of rows the menu has, and you can change what item is in each slot. Click on an empty slot and click on an item in your inventory, and it will put that item within that slot of the menu (quantities included). And if you want to change the item in a slot, right click it instead, because if there is already an item in a slot and you left click it, it will bring you to a menu that allows you to add actions to it. These designated actions will activate upon the clicking of this item within the menu.

Custom Commands
You can create your own custom commands by first inputting the name of the command (don't type in the / when inputting the name), and from there, you know the drill: you can apply actions to this command that will activate upon the execution of this command via typing /, followed by the name of the command. This is a nice follow up to custom menus, because commands is one of the ways you could access a custom menu, because one of the actions is "display menu."

NPCs
These are lifeless characters you can place down. You can only place a limited number of these, though you can place a good amount of them, and you can set them so they constantly look at the player, and, you guessed it, apply actions to it that activate upon the player left or right clicking the NPC. You can also rename the NPC, and choose from a giant catalog of skins. You can even search for keywords if you're looking for a specific looking skin.

Scoreboard
The scoreboard is the thing that is always to the very right of your screen in housing (though it tends to almost always be there in Hypixel), but in housing, you can customize what is there. You can shift + left click an item to move it to the left (which on the scoreboard moves it up), and shift + right click to move it the other way.

Syntax
The way you reference stats in housing through text is first by putting them in percentage signs beginning and end, typing "stat" to specify that it is a stat, put a period followed by either "player" or "global," to specify if it is a player stat or a global stat, a slash followed by the name of the stat. So it will look like this: %stat.player/RickAstley%, as an example. So if you put a custom message as an item on the scoreboard and wanted it to display a specific stat, that's how you would type it in. There are also built in stats that go by different names, such as your house's weekly cookies referenced not by %stat.global/Cookies," but rather %house.cookies%. You can create a stat called Cookies. Do /placeholders to find out the whole list of these.
This is a universal thing, but some Minecraft data packs allow you to use color codes to specify the color of the text you want to say. They are the following:
&4 = dark red
&c = red
&6 = gold
&e = yellow
&2 = dark green
&a = green
&b = aqua
&3 = dark aqua
&1 = dark blue
&9 = blue
&d = light purple
&5 = dark purple
&f = white
&7 = gray
&8 = dark gray
&0 = black

&l = bold
&o = italic

&m = strikethrough
&n = underline

&r = reset to default color
&k = obfuscated, completely unrecognizable down to every pixel, basically looks like TV static.

Some data packs even allow you to input the exact hex code of the color you want, but Hypixel unfortunately does not use one that does that. The syntax here is the & symbol, followed by either a number or a letter. Not all letters will do anything, but all numbers will. After you type it in, you can immediately start typing your text, even if it's right after it. If I wanted to type "Never gonna give you up" in bold letters, I could to "&lNever gonna give you up," and that would do the trick.

Putting it All Together
Even after you know all of these things, it may be hard to know exactly how to configure something. Each one of these features brings something different to the table, and they are all their own tools and components that can be used mechanistically to create a contraption of your own creation. After you know the functions of each and every one of these features, you must also gain an intuition for exactly how to do things. It's good to think of a feature you want to add to your house, and be able to start thinking of ways you could do it rather quickly. This also will allow you to understand the why and the how, as well as what to look out for. Let's look at a few examples.

  • Lifetime cookie counter: %house.cookies% only counts your weekly cookies and resets every Sunday. If you want a lifetime cookie counter, you're going to need a specific contraption. For this example, and all of the examples to come, the names of the stats I will be mentioning are arbitrary, and you could assign them any name you want as long as you can keep track of what function they serve. Create a function we'll call "Lifetime Cookies." For the first action, we will add a conditional. The conditional is an action that only activates if a specific condition is met. In the condition, put a "global stat requirement," set the stat to "previous_cookies," set the comparator to "less than," and set the compared value to "%house.cookies%." In plain English, the condition is: if the value of the global stat "previous_cookies" is less than the value of %house.cookies%. From there, in the "if actions," we will have five actions that are all "change global stat." In the first one, set the stat to "temp," set the mode to "set," and set the amount to %house.cookies%. This will set the value of the global stat "temp" to the value of %house.cookies%. In the second action, set the stat to "temp," set the mode to "decrement," and set the amount to "%stat.global/previous_cookies%." This will subtract the value of the global stat "previous_cookies" from the value of the global stat "temp." In the third action, set the stat to "lifetime_cookies," the mode to "increment," and the amount to "%stat.global/temp%." This will add the current value of the global stat "temp" to the current value of the global stat "lifetime_cookies." In the fourth action, set the stat to "temp," the mode to "set," and the value to 0. This will set the value of the global stat "temp" to zero. And in the fifth action, set the stat to "previous_cookies," set the mode to "set," and set the amount to %house.cookies%. Finally, set the function to an automatic execution. I would recommend every 200 ticks, or every 10 seconds, because there's no reason for it to run every 4 ticks, it'll just waste resources. Okay, that was a lot, but let's break down exactly what this contraption will do. In the beginning, the global stat "previous_cookies" is just zero, as that is what it defaults to. Until somebody gives your house a cookie. Let's say they are a non and you therefore receive just one cookie. The value of %house.cookies% has now been updated to 1. So now, the condition within the conditional is now met, as the value of previous_cookies is 0, whereas the value of %house.cookies% is 1, thereby making the value of previous_cookies less than the value of %house.cookies%, and so the condition is met. This will activate all of the actions within the "if actions" in the exact order you inputted them in, so make sure they were in the order I listed them. First, it will set the the value of the global stat "temp" to the value of %house.cookies%. In this case, %house.cookies% = 1, so "temp" gets set to 1. Then, the value of previous_cookies gets subtracted from the value of temp, which in this case is zero, so the value of temp remains 1. From there, lifetime_cookies gets increased by the value of temp, which is now 1, so lifetime_cookies increments by 1. And finally, temp gets reset to 0 and lifetime_cookies gets set to %house.cookies%, thereby preventing the conditional from activating again until a new cookie is given. And boom! We just incremented lifetime_cookies by %house.cookies%! But why? Why can't we just use %house.cookies%? Well, this is only if you don't want your cookie count to reset every Sunday. The key part is this last bit. Within the Lifetime Cookies function, add another conditional. The condition will be a global stat requirement, and this time, instead of previous_cookies being less than %house.cookies%, the condition is that it is greater than %house.cookies%. Within the "if actions," change global stat "previous_cookies" set %house.cookies%. And so, when %house.cookies% resets every Sunday, previous_cookies is now greater than %house.cookies%, so it will now be reset back to %house.cookies%. However, lifetime_cookies remains the value it is, and this mechanism will continue to work the way it used to, thereby incrementing lifetime_cookies by the same amount that %house.cookies% gets incremented, while at the same time not resetting when %house.cookies% resets. From there, you can display this in the scoreboard to display your lifetime cookies instead of weekly cookies by putting a text in the scoreboard: %stat.global/lifetime_cookies%. Or, the way I like to format it for aesthetic: &f&lCookies: &6&l%stat.global/lifetime_cookies%.
  • Playtime counter: this function will allow you to see how much time you have spent on the house. First, go to event actions and click on the "player join" event action, add a "change player stat" action, set the stat to "Loop," set the mode to set, and set the amount to 1. From there, go to the "player leave" event action, and do the exact same thing for the player join event action, except set the amount to 0 instead of 1. Next, create a function we'll call "Playtime." There will be four conditionals within this function. In the first conditional, the condition is a player stat requirement in which the player stat "Loop" has to be equal to 1. If this is true, then in the if actions, add a change player stat action in which it will increment the player stat "Seconds" by 1. In the second conditional, the condition is a player stat requirement in which the player stat "Seconds" has to be equal to 60. If this is true, then in the if actions, there is a change player stat that sets Seconds to 0, and a change player stat that increments Minutes by 1. In the third conditional, the condition is a player stat requirement in which the player stat "Minutes" has to be equal to 60. If this is true, then in the if actions, there is a change player stat that sets Minutes to 0, and a change player stat that increments Hours by 1. And in the fourth conditional, the condition is a player stat requirement in which the player stat Hours has to be equal to 24. If this is true, then in the if actions, there is a change player stat that sets Hours to 0, and a change player stat that increments Days by 1. And finally, set this function to an automatic execution, and set the number of ticks to exactly 20. This will make the function activate every second. So, when you join the house, your Loop stat gets set to 1, thereby meeting all of the criteria of the first condition. It will increment your Seconds stat by 1 every time the function executes, which is every second. However, once your Seconds stat reaches 60, the condition for the second conditional is met, and it will simultaneously set your Seconds to 0, and increment your Minutes by 1. Then, once your Minutes reaches 60, the condition of the third conditional is met, and it will simultaneously set your Minutes stat to 0, and increment your Hours stat by 1. Then, once your Hours stat reaches 24, the condition for the fourth and final conditional is met, and it will simultaneously set your Hours stat to 0, and increment your Days stat by 1. This process will update every single second, keeping the amount of time having passed accurate. However, when you leave the house, your Loop stat gets set to 0, and the conditions for the first conditional is no longer met, and it will therefore stop advancing your Seconds, which is good because you are not online. I don't have confirmation that it actually would advance even if you were offline provided the house were loaded, but I decided to put that in just for good measure. And if you want to create a command to see this, the text the command generates will be: %stat.player/Days%d %stat.player/Hours%h %stat.player/Minutes%m %stat.player/Seconds%s. As usual, I prefer to put it in bold letters, and I input it as white for good measure, so &f&l before it all, but that one's just an aesthetic choice. You may also notice the letters after the codes, which when you view it will show up as: "1d 2h 3m 4s" (numbers are just examples).
  • Player ID: this will be a number that shows you what iteration of player you are within this house. Are you the 1st, the 2nd, the 5,318,008th? Here's how to make a system like that. Within the player join event action, there will be a conditional. In the conditional, the condition will be a player stat requirement in which the "iteration" stat is equal to 0. If this is true, then in the if actions, a change player stat that sets iteration to 1, a change global stat that increments "joins" by 1, and a change player stat that sets iteration to %stat.global/joins%. So, when you join, your iteration stat is currently 0, so the condition of the conditional is met. From there, it will first set your iteration stat to 1 to ensure that this conditional won't be activated the next time you join, and it will increment the global stat "joins" by 1, which will tell you the total number of unique users that have joined your house, and it will then set your player_number to joins, which will successfully tell you what iteration of player you are on that specific house, or your player ID. When you join the next time, your iteration stat is now equal to 1, so the condition of the conditional is no longer met, and unless you make something that changes it (which if you did would beat the whole function of this contraption), the condition of the conditional will never be met for you ever again, giving you one player ID for life.

So yeah. That's how scripting in Hypixel housing works. I hope I've covered everything you need to know, and more importantly that you've actually comprehended the things I have said. It looks daunting so most people might not even get this far. Shout out if you have.

A Guide to Housing Scripting (2024)
Top Articles
Latest Posts
Article information

Author: Aracelis Kilback

Last Updated:

Views: 6273

Rating: 4.3 / 5 (44 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Aracelis Kilback

Birthday: 1994-11-22

Address: Apt. 895 30151 Green Plain, Lake Mariela, RI 98141

Phone: +5992291857476

Job: Legal Officer

Hobby: LARPing, role-playing games, Slacklining, Reading, Inline skating, Brazilian jiu-jitsu, Dance

Introduction: My name is Aracelis Kilback, I am a nice, gentle, agreeable, joyous, attractive, combative, gifted person who loves writing and wants to share my knowledge and understanding with you.