Michalina Barankiewicz

Stwórz mi datapack na system temperatury i do okoła otoczka

Kodari AI
KodariOct 20 at 6:06 pm 1
ThermalSystem
Adds a comprehensive temperature system to Minecraft. Tracks player temperature based on environmental factors like biome, weather, time of day, altitude, and proximity to heat/cold sources. Implements a temperature HUD display, thermal status effects (hypothermia, heatstroke), and survival mechanics requiring players to manage their body temperature through clothing, fire, water, and shelter. Includes configurable settings for temperature ranges, damage rates, and environmental modifiers.
  • System temperatury 0–100 z cyklicznym wpływem biomu, Netheru, wody, lawy i ogniska.

  • HUD, ostrzeżenia dźwiękowe oraz łagodne efekty przy skrajnych temperaturach.

  • Rejestracja funkcji ładowania i tick dla Minecrafta 1.21.4.

System temperatury 0–100 jest gotowy. Aktualizuje się co sekundę i reaguje na biomy, Nether, End, wodę, lawę, ogień oraz ogniska. Przy skrajnych wartościach pojawiają się ostrzeżenia i łagodne efekty.

  1. Pobierz ZIP przyciskiem Export i rozpakuj folder system_temperatury do world/datapacks/.

  2. W grze wpisz /reload, a następnie /datapack list, by sprawdzić, czy datapack został załadowany.

  3. Możesz przetestować system poleceniem /function temper:temperature/update_all.

Kodari can make mistakes. Review important code before using.
Files
system_temperatury
Code
10 83
system_temperatury/data/temper/function/temperature/update_player.mcfunction
scoreboard players set @s temp_delta 0
execute if score @s temperature matches ..49 run scoreboard players add @s temp_delta 1
execute if score @s temperature matches 51.. run scoreboard players add @s temp_delta -1
execute if dimension minecraft:the_nether run scoreboard players add @s temp_delta 4
execute if dimension minecraft:the_end run scoreboard players add @s temp_delta -1
execute if biome ~ ~ ~ minecraft:desert run scoreboard players add @s temp_delta 2
execute if biome ~ ~ ~ minecraft:badlands run scoreboard players add @s temp_delta 2
execute if biome ~ ~ ~ minecraft:eroded_badlands run scoreboard players add @s temp_delta 2
execute if biome ~ ~ ~ minecraft:wooded_badlands run scoreboard players add @s temp_delta 2
execute if biome ~ ~ ~ minecraft:savanna run scoreboard players add @s temp_delta 1
execute if biome ~ ~ ~ minecraft:savanna_plateau run scoreboard players add @s temp_delta 1
execute if biome ~ ~ ~ minecraft:windswept_savanna run scoreboard players add @s temp_delta 1
execute if biome ~ ~ ~ minecraft:snowy_plains run scoreboard players add @s temp_delta -2
execute if biome ~ ~ ~ minecraft:ice_spikes run scoreboard players add @s temp_delta -2
execute if biome ~ ~ ~ minecraft:frozen_ocean run scoreboard players add @s temp_delta -2
execute if biome ~ ~ ~ minecraft:deep_frozen_ocean run scoreboard players add @s temp_delta -2
execute if biome ~ ~ ~ minecraft:snowy_taiga run scoreboard players add @s temp_delta -2
execute if biome ~ ~ ~ minecraft:grove run scoreboard players add @s temp_delta -2
execute if biome ~ ~ ~ minecraft:snowy_slopes run scoreboard players add @s temp_delta -2
execute if biome ~ ~ ~ minecraft:jagged_peaks run scoreboard players add @s temp_delta -2
execute if biome ~ ~ ~ minecraft:frozen_peaks run scoreboard players add @s temp_delta -2
execute if biome ~ ~ ~ minecraft:cold_ocean run scoreboard players add @s temp_delta -1
execute if biome ~ ~ ~ minecraft:deep_cold_ocean run scoreboard players add @s temp_delta -1
execute if block ~ ~ ~ minecraft:water run scoreboard players add @s temp_delta -1
execute if block ~ ~1 ~ minecraft:water run scoreboard players add @s temp_delta -1
execute if block ~ ~ ~ minecraft:lava run scoreboard players add @s temp_delta 4
execute if block ~ ~-1 ~ minecraft:lava run scoreboard players add @s temp_delta 2
execute if block ~ ~ ~ minecraft:fire run scoreboard players add @s temp_delta 2
execute if block ~ ~ ~ minecraft:soul_fire run scoreboard players add @s temp_delta 2
execute if block ~ ~-1 ~ minecraft:campfire[lit=true] run scoreboard players add @s temp_delta 2
execute if block ~ ~-1 ~ minecraft:soul_campfire[lit=true] run scoreboard players add @s temp_delta 2
execute if block ~ ~-1 ~ minecraft:powder_snow run scoreboard players add @s temp_delta -1
scoreboard players operation @s temperature += @s temp_delta
execute if score @s temperature matches ..0 run scoreboard players set @s temperature 0
execute if score @s temperature matches 100.. run scoreboard players set @s temperature 100
execute if score @s temperature matches ..15 unless score @s temp_state matches 1 run function temper:temperature/cold_warning
execute if score @s temperature matches 85.. unless score @s temp_state matches 2 run function temper:temperature/hot_warning
execute if score @s temperature matches 16..84 unless score @s temp_state matches 0 run function temper:temperature/neutral_warning
execute if score @s temperature matches ..15 run effect give @s minecraft:slowness 3 0 true
execute if score @s temperature matches ..5 run effect give @s minecraft:weakness 3 0 true
execute if score @s temperature matches 85.. run effect give @s minecraft:slowness 3 0 true
execute if score @s temperature matches 95.. run effect give @s minecraft:weakness 3 0 true
title @s actionbar [{"text":"✦ TEMPERATURA  ","color":"gray","bold":true},{"score":{"name":"@s","objective":"temperature"},"color":"aqua","bold":true},{"text":" / 100","color":"dark_gray"}]