CAT IN THE HAT: MIDNIGHT GAMES v1.5.1 — Forge 1.20.1
Author: VoidStriker404

INSTALL
Place the v1.5.1 Cat mod jar in your Forge 1.20.1 profile's mods folder.
Install on both client and server for multiplayer. GeckoLib is not required;
this build uses a dedicated lightweight mesh renderer for your supplied model.
Do not double-click the jar as an app. Remove older Cat mod versions first.

ENCOUNTERS
15 minutes of active Survival play before the first encounter.
After each encounter, another randomized 10–20 minutes of active play.
Creative, Spectator and Peaceful players are excluded.
Natural stalking spawns in loaded, safe, dry ground spots about 20 blocks away.
Direct hide/music/chase commands use 32–48 blocks.
If there is no safe spot, it tries again later without loading new chunks.
Natural encounters start with 15 seconds of standing and staring; sometimes
he waves. He may knock at a nearby house before choosing a game.

HIDE AND SEEK
15 seconds to hide, then 45 seconds to remain out of sight.
The Cat searches, follows his last observed position, and needs about 1.5
seconds of continuous sight to find you. Getting within about 2 blocks also
reveals you. He cannot see through walls. Win and he leaves.

MUSICAL FREEZE
You may move during the silent warning and between rounds.
When the music starts, the message says DON'T MOVE. Looking around is allowed.
There is a 0.75-second reaction allowance. Displacement beyond 0.3 blocks then
triggers a chase (including jumping, falling or being pushed). Three 21.2-second
music rounds win the encounter. Music stops immediately on failure or success.
The newly supplied Berserk theme plays during every chase and throughout
hide-and-seek. Crooked Waltz plays during freeze rounds.

CHASE AND MOVEMENT
A chase lasts at most 60 seconds. Survive and he leaves.
He predicts movement, flanks at range, uses brief speed bursts, jumps when
stuck, climbs toward elevated targets, opens wooden doors and crawls under
low ceilings. Crawling reduces his collision height to 0.85 blocks.
He deals 6 base damage per hit before armor, at most once per 1.2 seconds.
He does not teleport through walls or destroy your house.

SOUNDS
The original sounds, new theme, and waltz are included. The previous
scream-and-run track is retained as the registered scream_and_run sound.
Background/voice cues share a randomized 45–100 second cooldown.
Door/window knock clips play once per actual knock interaction.
The first incidental cue waits 15 seconds. Music game cues follow the game
round timing. A transition stops previous Cat audio before starting new music.
The complete new theme is included and stops at the end of an encounter.
The 21.2-second waltz matches the full duration of each freeze round.
All audio is mono 22.05 kHz to reduce memory cost.

COMMANDS (cheats/operator permission required)
/cathat start hide
/cathat start music
/cathat start chase
/cathat start random
/cathat clear
/cathat timer
/cathat structure hat_tower
/cathat structure bow_tie_cottage
/cathat structure crooked_manor
/summon cathat:cat
A Cat spawn egg is also registered and can be obtained with:
/give @s cathat:cat_spawn_egg
A normally summoned Cat starts a random game with the nearest player.

CONFIGURATION
After first launch, edit config/cathat-common.toml with Minecraft closed.
You can change grace, encounter spacing, sound cooldowns and natural spawning.

MODEL AND PERFORMANCE
The supplied USDZ contained 1,988,228 triangles. This build uses:
- Close model: 3,000 source triangles, 1,482 unique animated vertices.
- Distant model: 500 source triangles, 240 unique animated vertices.
The close render emits 8,920 vertices (2,230 quads), compared with 96,000
vertices in v1.1. The distant render emits 1,820 vertices (455 quads).
Adjacent triangles are paired into real quads. Remaining triangles use
sealed subdivisions whose midpoint positions match adjacent skinned edges.
The smaller model is selected beyond 20 blocks and the detailed model
returns within 16 blocks, avoiding flicker at the switch boundary.
Animation updates are capped at 40 Hz and cached across shader/portal passes.
Walking, running, crawling, head tracking, tail movement and hits are retained.
Head pitch is limited to avoid extreme face/neck stretching.
Rebaked texture tiles now use six-pixel gutters, padded edge colors and
explicit nearest filtering to reduce seam flicker and neighboring-tile bleed.
Both PNGs are fully decoded and verified after packaging.
Rendering is standard Minecraft rendering, with no platform-specific binaries.
Actual Mac FPS and shader compatibility still require testing in your profile.

MUSIC PLAYBACK
Encounter music now uses a client cue packet and local, non-positional
playback. It does not fade when you run away and does not use Minecraft's
Music slider. Its volume follows Master Volume, which must be above zero.
Ending an encounter stops only the Cat's current local music.
Use /cathat soundtest chase or /cathat soundtest music to test it immediately.
Use /cathat soundtest stop to stop a test track.
All music is streamed from included OGG assets; it requires no online service.

SAVE/RELOAD
Encounter timers and entity game state persist. Reloading during a freeze
round gives a new 5-second warning before restarting its audible music.
Death, dimension changes, excessive distance, or successful escape end the
encounter and stop the Cat's current audio.

CLIMBING AND LEDGES
During a chase, the Cat can grip walls, travel beneath an overhang, climb
its outer edge, and pull himself onto the top. The planner follows reachable
surfaces and nearby corner holds; it does not teleport or break the cap.
It replans in bounded sections for taller pillars. Physical movement uses
collision-tested waypoints, with gravity restored on exit or route failure.
Wall climbing alternates reaching arms and bent knees. Hanging raises both
hands to grip the underside; the pull-up pose brings his arms over the edge.
The route was tested with a one-block pillar and a wider 3x3 cap.
This is not a guarantee against every possible roof, trap or inaccessible build.

NATURAL CAT HOUSES
Three red-and-white concrete houses are included:
Hat Tower: wide hat brim, striped tower, multiple floors and spiral stairs.
Bow Tie Cottage: striped gable roof, bow ornament, bedroom and cake table.
Crooked Manor: two floors, offset striped tower, staircase and furnished rooms.
They generate in NEW Overworld chunks, in plains, forests, taiga, savanna,
meadow, cherry grove and desert biomes. They do not appear retroactively in
already-generated chunks. A random-spread grid uses 24-chunk spacing and
8-chunk separation; a house attempt chooses one of the three at random.
Ocean biomes are excluded. Native structure generation does the placement;
there is no ongoing chunk scan or house-generation timer.

STRUCTURE COMMANDS
/cathat structure hat_tower
/cathat structure bow_tie_cottage
/cathat structure crooked_manor
Without coordinates, a house is placed on the surface about 20 blocks ahead.
Append x y z (including relative ~ coordinates) to choose its center and
foundation height. Placement replaces blocks inside that house's bounds.
/locate structure cathat:cat_house finds a naturally generated house location.

STALKING, WAVING AND KNOCKING COMMANDS
/cathat stalk — spawn about 20 blocks away, stare for 15 seconds, then leave.
/cathat wave — same encounter with a visible open-hand wave throughout the stare.
/cathat start stalk and /cathat start wave are aliases.
/cathat knock window [x y z] — appear beside glass and knock with a closed fist.
/cathat knock door [x y z] — knock with your supplied clip, then open the wooden door.
/cathat open_door [x y z] — open a wooden door immediately.
Without coordinates, interaction commands find the nearest reachable surface
within 12 blocks horizontally and up to 16 blocks above you. Commands need
cheats/operator permission and a Survival player (Creative is excluded by
the encounter rules). Glass blocks, stained glass and glass panes work.
Tall window interactions float up to put the fist beside the window; gravity
returns when the interaction ends. Wooden doors open both halves like vanilla
villager interactions; iron doors stay closed. Knocking and opening always
use a standing pose and standing collision height, with crawling disabled.
The outdoor side must offer room for the standing model. Inside spawn spots
are rejected, including ordinary summon/egg appearances under a roof. Blocks are never broken.
Knock animation and the supplied knock sound share the interaction timing.
Natural house generation and all prior game, structure and sound commands
remain available. In multiplayer all players must use this same v1.5.1 build.

APPROACH AND DISAPPEARANCE
Walking toward the Cat within four blocks during stalking, waving, knocking
or a door appearance makes him disappear and gives two seconds of blindness.
Looking around or standing still does not trigger it. A wall blocks the
approach trigger. Hide-and-seek and chase rules remain separate.

HUGE NEIGHBORHOOD
/cathat neighborhood [x y z]
Creates a 256 x 256 grid of 64 furnished houses using all three house styles,
with connected streets, sidewalks, gardens, small trees and streetlights.
Without coordinates, its center is 176 blocks ahead; the nearest edge is
about 48 blocks ahead. Coordinates choose the center and foundation height.
Placement replaces the blocks within its bounds. Construction is spread
across ticks, with progress every eight houses. Keep the world running until
the completion message. /cathat neighborhood cancel stops unfinished work.
Large connected neighborhoods also generate naturally in NEW Overworld
chunks. The native street-piece generator can join dozens of houses, with
up to seven expansion steps and a 116-block radius. Neighborhood placement
uses an 80-chunk spacing grid and 32-chunk separation, so it is much rarer
than an individual house. /locate structure cathat:cat_neighborhood finds one.

GESTURE ANIMATIONS
The original optimized body remains. During gestures, a separately articulated
arm replaces the fused hand/arm area, with an open palm and four fingers for
the wave, or a rounded closed fist with knuckles and a thumb for knocking.
It has separate shoulder and elbow joints and a lower-detail distant version.
Its arrays are reused across animation updates and portal/shadow passes.
Window knocks adjust hand height; tall windows float upward without crawling.

DOOR OPENING FIX
During a chase or search, nearby wooden doors open immediately when reachable.
Navigation plans through wooden doors. Opening does not depend on an outdoor
standing space or an exact waypoint height, so ordinary two-high rooms and
steps do not stall it. He pauses upright briefly while opening, then resumes
the encounter. Knock appearances still use the outdoor side and open after
the full knock clip. Doors remain open; no door-closing goal is installed.
/cathat open_door [x y z] opens a wooden door directly, including either half,
even when there is no outdoor space to summon a standing Cat beside it.
