Spooky season is here. Happy Halloween from Lattice!
Lattice
Docs/LatFrostbite

LatFrostbite

Players feel the winter cold: frost, breath and blizzards. Warm up by the fire.

No reviews yet

Overview

Module id
frostbite
Version
1.0.0
Platforms
foliapaper
Price
$3.99
Authors
Atlantis Services

Install

  1. Install Lattice on a Paper or Folia server, if it is not there yet.
  2. Drop the LatFrostbite jar into plugins/Lattice/modules/. It loads straight away.
  3. Put your license key in lattice.yml, then run /lat license refresh.
  4. Edit config/global/frostbite/ and apply it with /lat reload frostbite.

Commands

Command names and aliases are set in config.yml, so yours may differ. <required> [optional]

Command Description Permission
/frostbite
also /warmth
See how warm you are frostbite.use
/frostbite blizzard
Start or stop a blizzard frostbite.admin
/frostbite blizzard start [minutes]
Start a blizzard after the warning frostbite.admin
/frostbite blizzard stop
End a blizzard now frostbite.admin
/frostbite set <player> <warmth>
Set a player's warmth, for testing frostbite.admin
/frostbite cocoa <player> [amount]
Give a player Hot Cocoa frostbite.admin

Permissions

Permission Lets a player use
frostbite.use
/frostbite
frostbite.admin
/frostbite blizzard, /frostbite blizzard start, /frostbite blizzard stop, /frostbite set, /frostbite cocoa

Placeholders

Filled in Lattice's own messages, and in any plugin that reads PlaceholderAPI when it is installed.

Placeholder Notes
%frostbite_warmth%
%frostbite_stage%
%frostbite_blizzard%

Recipes

Crafted in a crafting table. Recipes of four items or fewer also fit the inventory grid.

Hot Cocoa

Shapeless

Drink it for a burst of warmth and a glow that keeps you warm for a while. Craftable only while it is cold.

Crafting
Glass Bottle
Cocoa Beans
Sugar
Milk Bucket
Hot Cocoa

Needs Glass Bottle, Cocoa Beans, Sugar, Milk Bucket

config.yml

Written to config/global/frostbite/config.yml on first start. Edit it, then /lat reload frostbite.

# Frostbite: winter cold your players can feel. Warmth runs from 100 (warm) to 0 (frozen).
# Rates are warmth points per second. Lattice reload applies changes, except where a comment says restart.

# Generated from FrostbiteSettings. Keys you delete return to their default;
# keys that are not in the schema are ignored and reported on load.

command:
  # Command for players and staff. Takes effect on restart.
  name: "frostbite"
  aliases:
    - "warmth"
  # Lets a player check their own warmth.
  permission: "frostbite.use"
  # Lets staff start blizzards, set warmth and hand out Hot Cocoa.
  admin-permission: "frostbite.admin"
  # Players given this permission explicitly never feel the cold. Being op alone does not count.
  exempt-permission: "frostbite.exempt"
# SURVIVAL: visuals, sounds, slowness, mining fatigue and freeze damage.
# COSMETIC: visuals and sounds only, no effects and no damage. Use it for lobbies.
mode: "SURVIVAL"
# Timezone for start, end and blizzard times, e.g. Europe/London.
timezone: "UTC"
# First day of the cold, as MM-DD, every year. Leave start and end empty for all year.
# An end before the start runs over the new year, e.g. 12-01 to 01-06.
start: "12-01"
# Last day of the cold, inclusive, as MM-DD.
end: "01-06"
# World names where it is cold. Empty means every overworld-type world; the Nether and the
# End are only cold if you list them. A world that is not loaded yet is fine.
worlds: []
# Ticks between updates for each player, at least 5. Twenty ticks make a second. Takes effect on restart.
tick-interval: 20
# Warmth a player has after respawning.
respawn-warmth: 60.0
# Minutes a player's warmth is remembered after they leave, so logging out and back in
# does not warm anyone up. Warmth is kept in memory only and is gone after a restart.
remember-minutes: 10
# Server TPS below this halves the particles and sounds, and below half of it stops them until
# TPS recovers. Warmth keeps changing either way. 0 turns the back-off off.
tps-floor: 18.0
stages:
  # Below this warmth a player is Chilly: breath shows, frost starts at the screen edge.
  chilly: 70.0
  # Below this a player is Cold: wind sound outdoors, and Slowness in survival.
  cold: 40.0
  # Below this a player is Freezing: heavy frost, shivering, and Mining Fatigue in survival.
  freezing: 20.0
  # Below this a player has Frostbite: heartbeat, and freeze damage in survival.
  frostbite: 5.0
chill:
  # Warmth lost every second anywhere it is cold, even in a mild biome.
  season: 0.05
  # Warmth lost per second for each point the biome temperature is below threshold. A biome
  # warmer than threshold warms instead (deserts, jungles). Altitude lowers biome temperature.
  biome-scale: 0.2
  # Biome temperature that feels neutral. Plains are 0.8, snowy biomes 0 or below, deserts 2.0.
  biome-threshold: 0.8
  # Extra warmth lost per second at night.
  night: 0.05
  # Extra warmth lost per second in rain or snowfall under open sky.
  precipitation: 0.08
  # Extra warmth lost per second while standing in powder snow.
  powder-snow: 1.0
  # Under a roof, the cold is multiplied by this. 0.3 means shelter keeps out 70% of it.
  shelter-factor: 0.3
  # A solid block within this many blocks above a player's head counts as a roof.
  roof-check: 12
heat:
  # How far around a player heat sources are found, in blocks, 1 to 6.
  radius: 3
  # Ticks between looking for heat sources around a player. Lower finds a new fire sooner and costs more.
  scan-interval: 40
  # Blocks that give heat and how much per second right next to them; it fades with distance.
  # Campfires, furnaces and other blocks that can be lit only count while lit.
  sources:
    CAMPFIRE: 1.5
    SOUL_CAMPFIRE: 1.2
    FIRE: 1.4
    SOUL_FIRE: 1.2
    LAVA: 1.5
    FURNACE: 1.0
    BLAST_FURNACE: 1.0
    SMOKER: 1.0
    MAGMA_BLOCK: 0.6
    LANTERN: 0.2
    SOUL_LANTERN: 0.15
    TORCH: 0.15
    WALL_TORCH: 0.15
  # Most heat per second all nearby sources together can give.
  max: 2.0
  # Items held in the off-hand that warm the player, and how much per second. Hand warmers.
  hand-warmers:
    TORCH: 0.1
    SOUL_TORCH: 0.08
    LANTERN: 0.12
    SOUL_LANTERN: 0.1
  # Heat per second from sprinting.
  sprint: 0.05
huddle:
  # Other players within this many blocks keep each other warm.
  radius: 3.0
  # Heat per second for each player huddled close.
  per-player: 0.1
  # Most heat per second from huddling, however many players.
  max: 0.3
  # A campfire gathering: this many players (counting yourself) close together near a heat
  # source get an extra cosy boost and floating hearts. 0 turns gatherings off.
  gathering-players: 3
  # Heat per second each player in a gathering gets on top of everything else.
  gathering-heat: 0.3
  # Heat from nearby blocks a gathering needs, so three players in a field do not count.
  gathering-needs-heat: 0.5
insulation:
  # Worn items and how much of the cold each one keeps out. 0.2 is 20%.
  pieces:
    LEATHER_HELMET: 0.1
    LEATHER_CHESTPLATE: 0.2
    LEATHER_LEGGINGS: 0.15
    LEATHER_BOOTS: 0.1
  # Most of the cold clothing can keep out together, below 1 so nobody is immune.
  max: 0.8
wet:
  # While wet, the cold is multiplied by this.
  multiplier: 2.0
  # Seconds a player stays wet after leaving water or rain.
  seconds: 60
  # Next to at least this much heat, a player dries faster.
  dry-heat: 0.5
  # How many times faster a player dries next to heat.
  dry-speed: 4
cocoa:
  # Lets players craft Hot Cocoa while it is cold: glass bottle, cocoa beans, sugar and a milk bucket.
  enabled: true
  # Warmth given at once when drunk.
  warmth: 25.0
  # Seconds the drink keeps warming afterwards.
  buff-seconds: 120
  # Heat per second while the drink keeps warming.
  buff-heat: 0.3
  # Colour of the drink, as a hex code.
  color: "#6b3a1f"
snowball:
  # Snowballs that hit a player cool them down. Never in COSMETIC mode.
  enabled: true
  # Warmth a snowball hit takes away.
  chill: 4.0
effects:
  # The frost over the screen, the same as standing in powder snow, growing as warmth drops
  # below stages.chilly. It never reaches the point where vanilla deals freeze damage.
  frost: true
  # Puffs of breath, seen by everyone nearby, once a player is Chilly.
  breath: true
  # Ticks between puffs of breath. Sprinting halves it.
  breath-interval: 40
  # A thermometer on the action bar. It hides once a player is warm again.
  thermometer: true
  # Segments in the thermometer.
  thermometer-segments: 10
  # The thermometer hides when warmth is at or above this.
  thermometer-hide-above: 95.0
  # Floating hearts over a campfire gathering.
  gathering-hearts: true
  # Steam rising from a player who just drank Hot Cocoa.
  cocoa-steam: true
sounds:
  # Wind on open ground once a player is Cold, and louder in a blizzard.
  wind:
    # Sound key, e.g. minecraft:item.elytra.flying. Empty turns this sound off.
    key: "minecraft:item.elytra.flying"
    volume: 0.12
    pitch: 0.6
    # Ticks between plays.
    every: 100
  # Shivering once a player is Freezing.
  shiver:
    # Sound key, e.g. minecraft:item.elytra.flying. Empty turns this sound off.
    key: "minecraft:entity.player.hurt_freeze"
    volume: 0.25
    pitch: 1.3
    # Ticks between plays.
    every: 80
  # A slow heartbeat once a player has Frostbite.
  heartbeat:
    # Sound key, e.g. minecraft:item.elytra.flying. Empty turns this sound off.
    key: "minecraft:block.note_block.basedrum"
    volume: 0.7
    pitch: 0.5
    # Ticks between plays.
    every: 20
  # Fire crackle while a cold player warms up next to heat.
  thaw:
    # Sound key, e.g. minecraft:item.elytra.flying. Empty turns this sound off.
    key: "minecraft:block.campfire.crackle"
    volume: 0.6
    pitch: 1.0
    # Ticks between plays.
    every: 60
  # How much louder the wind is in a blizzard.
  blizzard-wind: 2.5
survival:
  # Slowness I while Cold or worse.
  slowness: true
  # Mining Fatigue I while Freezing or worse.
  mining-fatigue: true
  # Freeze damage, in half hearts, dealt each damageInterval while a player has Frostbite.
  freeze-damage: 1.0
  # Ticks between freeze damage.
  damage-interval: 80
  # Freeze damage stops at this much health, in half hearts, unless lethal is true.
  min-health: 2.0
  # Let the cold kill. Off by default: frostbite hurts but leaves the player alive.
  lethal: false
blizzard:
  # Blizzards at all. Staff can still start one with the command when this is false.
  enabled: true
  # Clock times a blizzard starts, as HH:mm in timezone, e.g. ["20:00"]. The warning comes before.
  times: []
  # Chance of a random blizzard in any hour while someone is online, 0 to 1.
  chance-per-hour: 0.15
  # Minutes after a blizzard ends before a random one can start.
  cooldown-minutes: 60
  # How long a blizzard lasts, in minutes.
  minutes: 5
  # Seconds of warning before it starts. 0 starts it at once.
  warning-seconds: 120
  # The cold is multiplied by this during a blizzard, under shelter too, though shelter still helps.
  chill-multiplier: 2.5
  # Snowflakes drawn around each player per update during a blizzard.
  particles: 60
  # How far around a player the blizzard snow is drawn, in blocks.
  radius: 10.0
  # Tell clients to render snowfall during a blizzard. Only the player sees it; the world's weather is untouched.
  client-weather: true

Messages

Every line players see, in config/global/frostbite/messages.yml. Uses MiniMessage formatting.

Show messages.yml (57 lines)
# Player-facing text for frostbite.
# Placeholders in {braces} are filled in by the module.
# A key you delete falls back to its built-in default.

amount-range: Amount must be a number from 1 to 64.
bar-chilly: <yellow>▮
bar-cold: <aqua>▮
bar-empty: <dark_gray>▯
bar-freezing: <blue>▮
bar-frostbite: <dark_blue>▮
bar-warm: <gold>▮
blizzard-bar: <white>Blizzard <gray>- {time} left
blizzard-bar-warning: <white>Blizzard in {time} <gray>- find shelter
blizzard-end: <body>The blizzard has passed.
blizzard-none: There is no blizzard to stop.
blizzard-off-season: Blizzards only come while it is cold. Change start and end to
  test outside the season.
blizzard-running: A blizzard is already on its way.
blizzard-start: <accent>The blizzard is here.</accent> <body>Stay under a roof and
  close to a fire.
blizzard-started: <body>Blizzard on its way.
blizzard-stopped: <body>Blizzard stopped.
blizzard-warning: <accent>A blizzard is coming.</accent> <body>Find shelter in {time}.
cocoa-drink: <body>Warmth spreads through you.
cocoa-given: <body>Gave <accent>{amount}</accent><body> Hot Cocoa to <accent>{player}</accent><body>.
cocoa-lore:
- <!italic><gray>Warms you to your toes.
- <!italic><gray>Drink it out in the cold.
cocoa-name: <!italic><gold>Hot Cocoa
cocoa-off: Hot Cocoa is turned off in the config.
death: '{player} froze to death.'
feel-chilly: <muted>A chill creeps in. Your breath clouds in the air.
feel-cold: <body>Your fingers are going numb. <muted>Find a fire or a roof.
feel-freezing: <body>You can't stop shivering. <muted>Get warm, now.
feel-frostbite: <danger>Frostbite!</danger> <body>Your heartbeat slows in the cold.
feel-warm: <muted>Warmth spreads back into your hands.
gathering: <muted>Gathered around the fire, you feel cosy.
not-in-season: <body>The cold has not come yet.
players-only: Only a player can do that.
set-done: <body>Set <accent>{player}</accent><body>'s warmth to <accent>{warmth}</accent><body>.
stage-chilly: Chilly
stage-cold: Cold
stage-freezing: Freezing
stage-frostbite: Frostbite
stage-warm: Warm
status: <body>You feel <accent>{stage}</accent> <muted>({warmth}/100)
status-exempt: <body>The cold does not touch you here.
status-tip: <muted>Warm up by a campfire, under a roof, close to friends, in leather,
  or with a Hot Cocoa.
status-wet: '<body>You are <accent>soaked</accent><body>: the cold bites twice as
  hard until you dry.'
thermometer: <white>❄ {bar} <accent>{stage}</accent>{wet}
thermometer-wet: ' <aqua>Soaked'
unknown-player: No player called {player} is online.
warmth-range: Warmth must be a number from 0 to 100.
wet-on: <body>You are <accent>soaked through</accent><body>. The cold bites twice
  as hard until you dry off by a fire.