Minecraft Data Packs / Extensive

Dynamic Temperature in Minecraft

  • check_circle Advancements
  • check_circle Functions
  • 13,315 views, 9 today
  • 694 downloads, 0 today
  • 12
  • 10
  • 7
Jevex avatar Jevex
Level 26 : Expert Engineer
Dynamic Temperature in Minecraft Minecraft Data Pack
>>> Minecraft Forums Project Link: Click Here <<<

>>> Older Versions: Click Here <<<

Dynamic Temperature in Minecraft Minecraft Data Pack
Dynamic Temperature in Minecraft is a project inspired by the development of temperature mechanics for Vech's latest map Iceolation and is designed to add relatively unobtrusive content to the game. The way the system works is based on a variety of environmental factors which detects nearby blocks, the player's current biome, whether the player is swimming in water or lava, and more.

Your temperature can range between -1000 and 1000 heat units (HU) and will give the player debuffs if your temperature wanders toward the extremes (±600 HU). These debuffs include slowness, mining fatigue, blindness, hunger, weakness, and wither with the effects being mild around ±600 HU but deadly around ±900 HU.

Armor serves as insulation for the player, decreasing the effect environmental factors have on the player while equipped. Should the player need to warm up, they can stand by a fire, a torch, or a lit furnace; or if they should need to cool off, they can jump into water or curl up by some ice. When heating up or cooling down, changes to your temperature will occur every two seconds.

Dynamic Temperature in Minecraft Minecraft Data Pack
To start, I seriously need to thank TheRedEngineer for his work in creating a biome detection system. I cannot even begin to imagine the time and headache he saved me. If you want to check out any of his Minecraft commands you can visit his website at www.theredengineer.com or check out his YouTube Channel.

Each biome has a base temperature which serves as the largest contribution to calculating the ambient temperature of a biome. Although other factors like time of day, altitude [​upcoming], and the weather [​upcoming] can also affect the temperature of a biome, adjustments from those other environmental factors only serve to modify the base temperature of a biome. These values can be viewed in the spoiler below, and the effects of those temperature values will be explained in the Ambient Temperature description.

Biome Temperatures
Hot Biomes:
900 HU The Nether
600 HU Desert
600 HU Desert Hills

Warm Biomes:
500 HU Desert Lakes
400 HU Badlands
400 HU Badlands Plateau
400 HU Eroded Badlands
400 HU Modified Badlands Plateau
400 HU Modified Wooded Badlands Plateau
400 HU Wooded Badlands Plateau
300 HU Jungle
300 HU Jungle Edge
300 HU Jungle Hills
300 HU Modified Jungle
300 HU Modified Jungle Edge
300 HU Savanna
300 HU Savanna Plateau
300 HU Shattered Savanna
300 HU Shattered Savanna Plateau
300 HU Warm Ocean
250 HU Bamboo Jungle [​Upcoming 1.14]
250 HU Bamboo Jungle Hills [​Upcoming 1.14]

Temperate Warm Biomes:
200 HU Deep Lukewarm Ocean
200 HU Deep Warm Ocean
150 HU Swamp
150 HU Swamp Hills
100 HU Lukewarm Ocean

Temperate Biomes:

0 HU Beach
0 HU Birch Forest
0 HU Birch Forest hills
0 HU Flower Forest
0 HU Forest
0 HU Ocean
0 HU Plains
0 HU River
0 HU Sunflower Plains
0 HU Tall Birch Forest
0 HU Tall Birch Hills
0 HU The Void

Temperate Cool Biomes:

-100 HU Dark Forest
-100 HU Dark Forest Hills
-100 HU End Barrens
-100 HU End Highlands
-100 HU End Midlands
-100 HU Small End Islands
-100 HU The End
-100 HU Mushroom Fields
-100 HU Mushroom Fields Shore
-100 HU Wooded Hills
-200 HU Giant Spruce Taiga
-200 HU Giant Spruce Taiga Hills
-200 HU Giant Tree Taiga
-200 HU Giant Tree Taiga Hills
-200 HU Taiga
-200 HU Taiga Hills
-200 HU Taiga Mountains

Cool Biomes:
-250 HU Gravelly Mountains
-250 HU Gravelly Mountains+
-250 HU Mountain Edge
-250 HU Mountains
-250 HU Stone Shore
-250 HU Wooded Mountains
-300 HU Snowy Beach
-300 HU Snowy Mountains
-300 HU Snowy Taiga
-300 HU Snowy Taiga Hills
-300 HU Snowy Taiga Mountains
-300 HU Snowy Tundra
-400 HU Cold Ocean
-500 HU Deep Ocean
-550 HU Frozen River

Cold Biomes:
-600 HU Deep Cold Ocean
-600 HU Frozen Ocean
-700 HU Ice Spikes
-800 HU Deep Frozen Ocean

Outdated Description for Version 1.0 - 1.1
Each biome has an ambient temperature which serves as a baseline for the player's temperature. The ambient temperature will attempt to drag the player's temperature down if it is above the biome's ambient temperature and pull it up if the player's temperature is lower than the biome's ambient temperature. This effect will become more drastic if the difference between the player's temperate and the biome's temperature is greater than ±200 HU. For instance, if a biome has a temperature of 400 HU and the player's temperature is -200 HU, the biome will add 10 HU to the player's temperature; but when the player's temperature reaches 200 HU, the biome will only add 5 HU. The following section will list all biomes and their pre-defined ambient temperatures:

As of Dynamic Temperature in Minecraft Version 2.0 air temperature has been implemented as a modifier for a biome's temperature. During the day, the air temperature of each biome is programmed to increase while the opposite is true for at night (exact values can be found in the spoiler below). Another feature of air temperature is that unlike biome temperature, the temperature of the air will not affect a player that is underwater or swimming in lava. If you would like to know how Minecraft represents time, you can either go to the Minecraft Wiki or type the command "/time query daytime" into chat to see check the current time of day in-game. Generally though, one can get by just with remembering that Time 0 is basically the start of daytime, Time 6000 is noon, Time 12000 is the start of the night, and Time 18000 is midnight.

Air Temperature Modifiers
Time of Day:
+00 HU Time [​0..2999]
+25 HU Time [​3000..5999]
+50 HU Time [​6000..8999]
+25 HU Time [​9000..11999]

-00 HU Time [​12000..14999]
-25 HU Time [​15000..17999]
-50 HU Time [​18000..20999]
-25 HU Time [​21000..23999]

NOTE: Time of Day does NOT affect players below y-level 62

As of Dynamic Temperature in Minecraft Version 2.0 ambient temperature has taken over the role of biome temperature as a way to integrate the new air temperature mechanic. The ambient temperature will attempt to drag the player's temperature down if it is above the ambient temperature and pull it up if the player's temperature is lower than the ambient temperature. This effect will become more drastic if the difference between the player's temperate and the ambient temperature is greater than ±200 HU. For instance, if the ambient temperature is 400 HU and the player's temperature is -200 HU, the player will have 10 HU added to their temperature; but when the player's temperature reaches 200 HU, the biome will only add 5 HU. As such, the effect of ambient temperature on the player will disappear if the ambient temperature and the player's temperature is the same.

As opposed to ambient temperature, blocks and fluids require close proximity to the player to have an effect. As a general rule, if a block is solid (e.g. magma blocks and lit furnaces), then it will only affect players immediately next to it. However, if the player can occupy the same space as the block (e.g. torches, and snow layers) then the player must occupy the space of the block. The one exception to this rule is fire. If the player is standing in fire, they will gain heat faster than if they stand adjacent to it, however, the player is not required to occupy the same space to get an effect.

Block/Fluid Temperatures
Warm Blocks/Fluids:
+10 HU Lava
+8 HU Fire [​If in Fire]
+7 HU Magma Block
+5 HU Fire [​If Adjacent to Fire]
+5 HU Lit Furnace
+3 HU Torch

Cold Blocks/Fluids:
-10 HU Water [​In Cool/Cold Biomes]
-8 HU Water [​In Temperate Biomes]
-6 HU Water [​In Warm/Hot Biomes]
-9 HU Blue Ice
-7 HU Packed Ice
-3 HU Ice
-2 HU Snow Block
-2 HU Snow Layer

Installing a datapack is very similar to downloading a Minecraft world. The only difference is that instead of pasting the datapack into Minecraft's 'save' folder you have to place the extracted datapack into the save's 'datapack' folder. For a more detailed walkthrough, please reference the spoiler below:

Installing a Datapack

Step One:
Download the datapack extract the zip file.

Step Two:
Navigate to the game file you wish to install the datapack into and select "Edit"

Step Three:
Select "Open World Folder"

Step Four:
Open your "datapacks" folder.

Step Five:
Paste the extracted file into your datapacks folder.

You are now done and your datapack should now be installed!
If you did this process while the world was open, don't forget '/reload' to restart the datapack.

Change Temperature Based on Time of Day:
- Have ambient biome temperatures increase in the morning and decrease at night
- Increase heating effect during the day for deserts and other hot biomes (e.g. mesa and savannah)
- Increase cooling effect at night for deserts and cool biomes

Change Temperature Based on Weather:
- Increase temperature in Jungle when raining
- Decrease temperature in warm biomes slightly when raining
- Decrease temperature in hot biomes significantly when raining
- Decrease temperature in cool biomes slightly when raining
- Decrease temperature in cool biomes significantly when raining
- Decrease temperature in cold biomes drastically when snowing

Change Temperature Based on Player Y-Level:
- Decrease temperature as altitude increases from sea-level
- Increase temperature as altitude decreases from sea-level

Change Temperature Based on Player Movement:
- Increase temperature if the player is running
- Decrease temperature if the player is flying (using elytra) or falling

Changes From Suggestions:
- Comment below if you have any thoughts on what else should be added

CreditTheRedEngineer - Biome Detection
CompatibilityMinecraft 1.13

1 Update Logs

Air Temperature Update : 01/17/2019 2:53:06 pmJan 17th, 2019

Dynamic Temperature in Minecraft Version 2.0
- Added Air Temperature Mechanic
  - Air Temperature fluctuates according to the time of day
  - Air Temperature does not affect players below y-level 62 or players swimming in water or lava
- Added Ambient Temperature to merge Biome Temperature with Air Temperature

Create an account or sign in to comment.

03/04/2020 4:45 amhistory
Level 29 : Expert Dragonborn
Galdeveer avatar
Here are some thoughts. I tried my best to be practical about what could be reasonably implemented. I'd be curious to hear feedback if at any point you think there's a disconnect between the reality of what can be coded and what I'm suggesting. I am fairly well versed on the subject, but I'm sure there are gaps in my understanding I've missed along the way.

It would be interesting if the nether portal blocks counted as heat sources similar to what you've already implemented. It would be almost as if the heat of the nether was bleeding through.

Block checking can be resource-intensive, but since lakes are a biome that can be tested for, it would be interesting if while in this biome it checks if you are standing on an ice block. If so, there is a chance that the ice block will be replaced with frosted ice. The normal mechanic of frosted ice is already to crack and disappear. Since your already planning on testing for y levels, checking if the player is at sea level is another way to reduce block checking for this. The danger of falling into the freezing water would certainly be interesting addition. In order to reduce block checking, this does mean it would not work for other types of bodies of water which can't be tested for in this way.

In real life, right before someone freezes to death, the body generates a large amount of heat; so large, that people who have frozen to death are often found buried in the snow because they were trying to cool themselves down. Heating up by an extreme amount before then experiencing even worse effects from the cold could be an interesting phenomenon to add for when the player experiences cold temperatures for extended periods of time. Not sure if the fact is to obscure to be intuitive, but interesting none the less.

The use statistic can be used to check when the player 'uses' a bucket. If the player is in the desert and this statistic increments, check the main hand to see if it is a water bucket or a bucket. If its a water bucket, there's a chance of it evaporating. You wouldn't want players to just be able to carry around a portable source of cooling down.

Lastly, in real life, cacti are able to store more water in themselves than normal plants; thus one of the reasons they survive in the desert. It would make sense if the player could partially cooldown by collecting cactus water. Obviously, this needs to be balanced. The game depletes hunger points based on when the player does things such as breaking blocks, waling, sprinting, etc. You could make it so that the only way to collect a cactus as a block is to break it with shears. Any other method of breaking it would result in a loot table randomly choosing whether to simply place the cactus block back or drop nothing and cool down the player who broke it. A difference in the utilized tool is important because you wouldn't want it to drop the block creating an infinite loop. By making it so there's a chance for the block to simply reappear, you're increasing the number of blocks breaking; thus, causing your hunger to deplete faster. Considering that hunger is already a mechanic in deserts with husks, it makes sense to follow the theme. An alternative penalty could be the chance of taking a small amount of damage upon breaking it. A better system would need to be implemented considering that repeating the same task and expecting a different result isn't intuitive for players. Some sort of visual feedback or the previously stated alternative penalty could fix said issue.

Anything else I can think of would require more testing on my part to see if it can be done efficiently performance-wise. Regardless of whether any of this is considered, I'd just like to say well done. :D
03/28/2020 2:32 pm
Level 26 : Expert Engineer
Jevex avatar
Thank you for your interest in this project! I personally love the ideas you mentioned, specifically the idea of making freezing water more of a concern to the player. Unfortunately, I've been forced to put this project on hold indefinitely as a result of college, particularly since this was just a side project that was supposed to be a part of a much larger design. Perhaps in the coming days, I'll try to sneak in some new functionality, but I can't make any promises due to my schedule.
04/02/2020 12:33 am
Level 29 : Expert Dragonborn
Galdeveer avatar
:) Glad you liked it. I know what you mean about sidelining projects due to college. Can't spend much time on this stuff or I'll struggle not to think about it all week O_O.
02/04/2019 10:14 am
Level 6 : Apprentice Architect
Sir_Steggles avatar
could you please make it so tourches magma blocks and fire etc. emit heat further out frm the source. make it decrease the further away you are kind of like the light levels emitted by the blocks themselves

02/04/2019 9:15 pm
Level 26 : Expert Engineer
Jevex avatar
What you're asking for is possible, however, the issue is that for each additional block away from the heat source, the number of functions needed increases at an exponential rate. As of right now, each block that effects temperature has about 11 commands actively calculating temperature. If I want to increase the range by one block, I need to add probably 20 to 30 commands per block. If I want to increase the range by two blocks, I probably need an additional 30 commands on top of the existing ones. And this is just a rough estimation without doing any math so this might be a bit exaggerated, but I can only imagine computers crying over an additional thousand lines needing to be calculated per player.

So, is it possible, yes, but I think I'd need to create a separate single-player version, or simply label it as a more resource intensive option. If you think your computer can deal with the extra stress, I can probably develop a version along the lines of what you're suggesting, but it might take a while since I'm currently working on updating another project called "Super Hostile Online" to 1.13 for Vechs (if you're unfamiliar with his work, I'd recommend Googling Super Hostile CTM).
02/05/2019 5:41 am
Level 6 : Apprentice Architect
Sir_Steggles avatar
oh boi yikes. yeah if it is going to cause massive issues for computures i think i can live without. wish mojang would add something like this data pack to the base game. really cool thing you've got here

02/05/2019 2:06 pm
Level 26 : Expert Engineer
Jevex avatar
First off, thanks for supporting the project! I really do appreciate your interest.

To be fair, it really just depends on how much memory you can dedicate to your game. If I spent some time reworking and optimizing the code, it should be possible to do what you're asking. For instance, I believe that to some extent, my computer could handle a larger system, but that I wouldn't be able to manage a server with the same data requirements. It's up to your discretion to determine if your computer could handle a larger datapack and how long you'd be willing to wait for an upgraded version.
Planet Minecraft


© 2010 - 2021