Phantom Keep

26.2.0.9.14Alpha by Elkonia

The Long Court still in session - twelve bosses, four rites, a deserted ward village and the Regalia.

Function Summary

NameDescription
phantoms_keep:armoryArmoury clock
phantoms_keep:armory_blankThe High Seat's own empty bracket
phantoms_keep:armory_oneArm one armour stand
phantoms_keep:armory_scanArm any new stands
phantoms_keep:armory_weaponRoll one weapon into a stand's hand
phantoms_keep:atmospherePhantom Keep - gloom and fog for one player
phantoms_keep:bell/ambientThe keep tolls its own answer at you
phantoms_keep:bell/ambient_stepOne tick of the ambient toll
phantoms_keep:bell/amb_1Ambient toll - note 1
phantoms_keep:bell/amb_2Ambient toll - note 2
phantoms_keep:bell/amb_3Ambient toll - note 3
phantoms_keep:bell/amb_4Ambient toll - note 4
phantoms_keep:bell/amb_5Ambient toll - note 5
phantoms_keep:bell/amb_resetEnd of a pass - rest, then begin again
phantoms_keep:bell/fitGive every bell near this player a hitbox, if it has not got one
phantoms_keep:bell/ghast_arriveIt heard you get it wrong
phantoms_keep:bell/ghast_waitHold the ghast back until the bell has spoken
phantoms_keep:bell/hit_1Bell 1 was struck
phantoms_keep:bell/hit_2Bell 2 was struck
phantoms_keep:bell/hit_3Bell 3 was struck
phantoms_keep:bell/hit_4Bell 4 was struck
phantoms_keep:bell/hit_5Bell 5 was struck
phantoms_keep:bell/pealEvery bell at once
phantoms_keep:bell/readoutSay out loud what the game thinks just happened
phantoms_keep:bell/right_1Bell 1 struck in sequence
phantoms_keep:bell/right_2Bell 2 struck in sequence
phantoms_keep:bell/right_3Bell 3 struck in sequence
phantoms_keep:bell/right_4Bell 4 struck in sequence
phantoms_keep:bell/right_5Bell 5 struck in sequence - the count is complete
phantoms_keep:bell/solvedFive bells, in order
phantoms_keep:bell/struckA bell's hitbox was struck - name it, hand off to the player, then disarm it
phantoms_keep:bell/tickThe bell puzzle - has anyone struck a bell?
phantoms_keep:bell/tollThe keep tolls while the boss stands
phantoms_keep:bell/toll_noteRing the next bell in the sequence, from every tower that holds it
phantoms_keep:bell/toll_stepOne beat of the toll
phantoms_keep:bell/wrongWrong bell - the count starts again
phantoms_keep:boss/addsThe Hollow Phantom calls its buddies
phantoms_keep:boss/ae_conjureSUMMONS - the court is called to order
phantoms_keep:boss/ae_contemptCONTEMPT - passed on whoever is keeping their distance
phantoms_keep:boss/ae_deniedSomebody was standing on it
phantoms_keep:boss/ae_dimThe room goes down with the sentence
phantoms_keep:boss/ae_fangsRING OF FANGS - the sigil's own geometry, used against you
phantoms_keep:boss/ae_gavelTHE GAVEL - he strikes the record and the floor goes out under it
phantoms_keep:boss/ae_healTwenty back
phantoms_keep:boss/ae_heldThis one is held in contempt
phantoms_keep:boss/ae_mendThe centre was empty
phantoms_keep:boss/ae_recusalRECUSAL - he withdraws to the centre of his own circle and mends
phantoms_keep:boss/ae_relightThe room comes back up
phantoms_keep:boss/ae_sentenceTHE SENTENCE - passed on whoever is standing close enough to hear it
phantoms_keep:boss/ae_snuffOne stone goes out
phantoms_keep:boss/ae_vacateVACATE THE FLOOR - fangs where each of you is standing
phantoms_keep:boss/altar_gateOffering scan entry point
phantoms_keep:boss/altar_gate_runThe altar, twice a second
phantoms_keep:boss/altar_idleIdle altar shimmer
phantoms_keep:boss/altar_scanIs an offering resting on an altar?
phantoms_keep:boss/altar_voiceThe altar, breathing
phantoms_keep:boss/archivist_tickThe Archivist, one tick
phantoms_keep:boss/arch_evoker_tickThe Arch-Evoker, per tick
phantoms_keep:boss/arena_closeBar the doorless entrance - the fight starts
phantoms_keep:boss/arena_openThe bars come down - nothing is left standing
phantoms_keep:boss/ar_blinkArchivist - blink
phantoms_keep:boss/ar_pagesArchivist - page storm
phantoms_keep:boss/bacon_diedBacon is killed, and something in the ward hears it
phantoms_keep:boss/barsBoss bars
phantoms_keep:boss/bm_broodThe brood - she is called the Broodmother for a reason
phantoms_keep:boss/bm_brood_stepOne broodling, glowing faintly green
phantoms_keep:boss/bm_venomThe venom - she rears, and the air goes green
phantoms_keep:boss/bm_webShe spits, and the floor grows a patch of web where you were standing
phantoms_keep:boss/bm_web_stepOne web cluster, counting down to nothing
phantoms_keep:boss/book_archivist_1The Archivist - Edition I, the verdict
phantoms_keep:boss/book_archivist_2The Archivist - Edition II, the case
phantoms_keep:boss/book_archivist_3The Archivist - Edition III, the whole history, signed
phantoms_keep:boss/book_arch_evoker_1The Arch-Evoker - Edition I, the verdict
phantoms_keep:boss/book_arch_evoker_2The Arch-Evoker - Edition II, the case
phantoms_keep:boss/book_arch_evoker_3The Arch-Evoker - Edition III, the whole history, signed
phantoms_keep:boss/book_broodmother_1The Broodmother - Edition I, the verdict
phantoms_keep:boss/book_broodmother_2The Broodmother - Edition II, the case
phantoms_keep:boss/book_broodmother_3The Broodmother - Edition III, the whole history, signed
phantoms_keep:boss/book_gate_captain_1The Gate-Captain - Edition I, the verdict
phantoms_keep:boss/book_gate_captain_2The Gate-Captain - Edition II, the case
phantoms_keep:boss/book_gate_captain_3The Gate-Captain - Edition III, the whole history, signed
phantoms_keep:boss/book_guard_1The Household Guard - Edition I, the work order
phantoms_keep:boss/book_guard_2The Household Guard - Edition II, the list
phantoms_keep:boss/book_guard_3The Household Guard - Edition III, the amendment
phantoms_keep:boss/book_hollow_phantom_1The Hollow Phantom - Edition I, the verdict
phantoms_keep:boss/book_hollow_phantom_2The Hollow Phantom - Edition II, the case
phantoms_keep:boss/book_hollow_phantom_3The Hollow Phantom - Edition III, the whole history, signed
phantoms_keep:boss/book_librarian_1The Librarian - Edition I, the verdict
phantoms_keep:boss/book_librarian_2The Librarian - Edition II, the case
phantoms_keep:boss/book_librarian_3The Librarian - Edition III, the whole history, signed
phantoms_keep:boss/book_mason_1The Mason - Edition I, the verdict
phantoms_keep:boss/book_mason_2The Mason - Edition II, the case
phantoms_keep:boss/book_mason_3The Mason - Edition III, the whole history, signed
phantoms_keep:boss/book_mirage_master_1The Mirage Master - Edition I, the verdict
phantoms_keep:boss/book_mirage_master_2The Mirage Master - Edition II, the case
phantoms_keep:boss/book_mirage_master_3The Mirage Master - Edition III, the whole history, signed
phantoms_keep:boss/book_pale_warden_1The Pale Warden - Edition I, the verdict
phantoms_keep:boss/book_pale_warden_2The Pale Warden - Edition II, the case
phantoms_keep:boss/book_pale_warden_3The Pale Warden - Edition III, the whole history, signed
phantoms_keep:boss/book_razorback_1The Razorback - Edition I, the stock book
phantoms_keep:boss/book_razorback_2The Razorback - Edition II, what it learned
phantoms_keep:boss/book_razorback_3The Razorback - Edition III, the last entry
phantoms_keep:boss/book_void_weaver_1The Void Weaver - Edition I, the verdict
phantoms_keep:boss/book_void_weaver_2The Void Weaver - Edition II, the case
phantoms_keep:boss/book_void_weaver_3The Void Weaver - Edition III, the whole history, signed
phantoms_keep:boss/boss_oneOne boss, one branch
phantoms_keep:boss/broodmother_tickThe Broodmother, per tick
phantoms_keep:boss/call_archivistAltar offering: The Archivist
phantoms_keep:boss/call_arch_evokerThe Recused Totem goes on the anchor
phantoms_keep:boss/call_broodmotherThe Broodmother's Eye goes on the anchor
phantoms_keep:boss/call_gate_captainAltar offering: The Gate-Captain
phantoms_keep:boss/call_hollow_phantomAltar offering: The Hollow Phantom
phantoms_keep:boss/call_household_guardAltar offering: The Household Guard
phantoms_keep:boss/call_librarianAn Unshelved Volume goes on the anchor
phantoms_keep:boss/call_masonAltar offering: The Mason
phantoms_keep:boss/call_mirage_masterThe False Glass goes on the anchor
phantoms_keep:boss/call_pale_wardenA Clot of Resin goes on the anchor
phantoms_keep:boss/call_razorbackAltar offering: The Razorback
phantoms_keep:boss/call_void_weaverA Thread of the Weave goes on the anchor
phantoms_keep:boss/cleanupTear down after a boss dies
phantoms_keep:boss/drop_all_threeThe Long Court Adjourned
phantoms_keep:boss/drop_archivistThe Archivist - kill reward
phantoms_keep:boss/drop_arch_evokerWhat is left of The Arch-Evoker
phantoms_keep:boss/drop_broodmotherWhat is left when she stops moving
phantoms_keep:boss/drop_gate_captainThe Gate-Captain - kill reward
phantoms_keep:boss/drop_guard_barThe Household Guard - the bar it was made from
phantoms_keep:boss/drop_guard_coreThe Household Guard - what was beating inside it
phantoms_keep:boss/drop_guard_plateThe Household Guard - its plating
phantoms_keep:boss/drop_hollow_phantomThe Hollow Phantom - kill reward
phantoms_keep:boss/drop_household_guardThe Household Guard - kill reward
phantoms_keep:boss/drop_librarianWhat the Under-Librarian leaves
phantoms_keep:boss/drop_lib_bootsTHE QUIET HOURS - what the staff was worn with
phantoms_keep:boss/drop_lib_staffQUIETUS - the staff he carried
phantoms_keep:boss/drop_lib_tomeThe overdue notice
phantoms_keep:boss/drop_masonThe Mason - kill reward
phantoms_keep:boss/drop_mason_coreA heavy core - one kill in ten
phantoms_keep:boss/drop_mason_hammerHale Brann's Hammer - one kill in ten
phantoms_keep:boss/drop_mason_tunicHale Brann's Tunic - one kill in five
phantoms_keep:boss/drop_mirage_masterWhat is left of The Mirage Master
phantoms_keep:boss/drop_pale_wardenWhat is left of The Pale Warden
phantoms_keep:boss/drop_razorbackThe Razorback - kill reward
phantoms_keep:boss/drop_razorback_cleaverThe Razorback - the tusk, sharpened
phantoms_keep:boss/drop_razorback_heartThe Razorback - what kept it running
phantoms_keep:boss/drop_razorback_hideThe Razorback - its hide
phantoms_keep:boss/drop_void_weaverWhat is left of The Void Weaver
phantoms_keep:boss/engageThis player has drawn blood - they are in the fight now
phantoms_keep:boss/fight_musicWhose track should this player be hearing?
phantoms_keep:boss/fight_music_startSILENCE THE KEEP FIRST. music.keep is a `record` sound - once started it runs to
phantoms_keep:boss/fight_music_stopThe fight is over - hand the room back to the keep
phantoms_keep:boss/gate_captain_tickThe Gate-Captain, one tick
phantoms_keep:boss/gc_guardsGate-Captain - call the watch
phantoms_keep:boss/gc_slamGate-Captain - shield slam
phantoms_keep:boss/hg_rivetThe Household Guard - it throws a rivet
phantoms_keep:boss/hg_stampThe Household Guard - the stamp
phantoms_keep:boss/hg_sweepThe Household Guard - the sweep
phantoms_keep:boss/hg_ventThe Household Guard - the plates open
phantoms_keep:boss/hg_vent_endThe Household Guard - the plates shut
phantoms_keep:boss/hollow_phantom_tickThe Hollow Phantom, one tick
phantoms_keep:boss/household_guard_tickThe Household Guard, one tick
phantoms_keep:boss/hp_galeHollow Phantom - wing gale
phantoms_keep:boss/librarian_tickThe Under-Librarian, per tick
phantoms_keep:boss/lib_blastThe blast - eight arms of the plates' own light
phantoms_keep:boss/lib_blast_hitAn arm of silence caught a player
phantoms_keep:boss/lib_blast_stepOne step of a silence arm
phantoms_keep:boss/lib_boltHe levels the staff and one arm of it goes out
phantoms_keep:boss/lib_book_hitA book found somebody
phantoms_keep:boss/lib_book_missA book hit a wall, or ran out of patience
phantoms_keep:boss/lib_book_stepOne thrown book, in flight
phantoms_keep:boss/lib_cage_burnCaught inside when the bolt landed
phantoms_keep:boss/lib_cage_clearThe cage is done - take all of it back
phantoms_keep:boss/lib_cage_stepOne tick of a shelving cage
phantoms_keep:boss/lib_caughtSomebody moved
phantoms_keep:boss/lib_darkThe room takes its light back
phantoms_keep:boss/lib_fangsA line of fangs down the floor
phantoms_keep:boss/lib_fang_stepOne step of the fang line
phantoms_keep:boss/lib_quietQUIET IN THE STACKS - he calls for silence, and means it
phantoms_keep:boss/lib_quiet_markSnapshot how far this player has walked so far
phantoms_keep:boss/lib_quiet_openOpen the silence window
phantoms_keep:boss/lib_quiet_testHas this player moved during the silence?
phantoms_keep:boss/lib_quiet_watchIs anybody moving?
phantoms_keep:boss/lib_recallRECALL - you may not take it out of the room
phantoms_keep:boss/lib_recall_pullDrag one reader back to the desk
phantoms_keep:boss/lib_shelvesSixteen stacks of books, grown in the dark
phantoms_keep:boss/lib_shelves_clearThe stacks come down with him
phantoms_keep:boss/lib_shelvingSHELVING - he files you where you stand
phantoms_keep:boss/lib_shoutWhat he says
phantoms_keep:boss/lib_shout_reset
phantoms_keep:boss/lib_starsThe warning shot - eight lines of stars where the blast will go
phantoms_keep:boss/lib_throwTHE RETURNS - he throws the books back at you
phantoms_keep:boss/lib_weightTHE WEIGHT OF THE STACKS - he puts the whole archive on your shoulders
phantoms_keep:boss/mark_fightersMark everyone in the fight
phantoms_keep:boss/mason_tickThe Mason, one tick
phantoms_keep:boss/mirage_master_tickThe Mirage Master, per tick
phantoms_keep:boss/mm_blindBLIND - the vanilla spell, given a wall to hide behind
phantoms_keep:boss/mm_doublesDOUBLES - three of him, and none of them are him
phantoms_keep:boss/mm_galleryTHE GALLERY - he hangs the room with himself
phantoms_keep:boss/mm_misdirectMISDIRECTION - you are the one who moves
phantoms_keep:boss/mm_recantRECANT - halfway down, he puts the candles out and makes you read the room again
phantoms_keep:boss/mm_seenHe is somewhere again
phantoms_keep:boss/mm_swapSWAP - he trades places with one of his own copies
phantoms_keep:boss/mm_unseenTHE UNSEEN - he stops being anywhere in particular
phantoms_keep:boss/ms_apprenticesThe Mason - apprentices
phantoms_keep:boss/ms_bat_biteA bat got you
phantoms_keep:boss/ms_bat_expireThe bat has had its thirty seconds
phantoms_keep:boss/ms_bat_tickOne of his bats, hunting
phantoms_keep:boss/ms_pealTHE PEAL - he rings every bell at once and the sound comes for you
phantoms_keep:boss/ms_shoutThe Mason - he has something to say about it
phantoms_keep:boss/ms_shout_resetReset the shout timer and shout
phantoms_keep:boss/ms_smashThe Mason - the hammer comes down
phantoms_keep:boss/ms_swarmTHE BELFRY EMPTIES - the rare one
phantoms_keep:boss/ms_wave_hitA Gong arm caught a player
phantoms_keep:boss/ms_wave_stepOne step of the Gong's wavefront
phantoms_keep:boss/music_archivistArchivist theme
phantoms_keep:boss/music_arch_evokerHis track
phantoms_keep:boss/music_broodmotherHer track
phantoms_keep:boss/music_captainGate-Captain theme
phantoms_keep:boss/music_librarian
phantoms_keep:boss/music_masonThe Mason's theme
phantoms_keep:boss/music_mirage_masterHis track
phantoms_keep:boss/music_pale_wardenHis track
phantoms_keep:boss/music_phantomHollow Phantom theme
phantoms_keep:boss/music_void_weaverHis track
phantoms_keep:boss/pale_warden_tickThe Pale Warden, per tick
phantoms_keep:boss/pw_fallTHE FALL - he brings a limb down where he stands
phantoms_keep:boss/pw_graspROOT-GRASP - the floor takes hold of whoever is standing on it
phantoms_keep:boss/pw_splinterSPLINTER - lesser creakings out of the dead roots
phantoms_keep:boss/pw_turningTHE TURNING - the chamber goes out
phantoms_keep:boss/razorback_tickThe Razorback, one tick
phantoms_keep:boss/rb_bellowThe Razorback - the bellow
phantoms_keep:boss/rb_chargeThe Razorback - it runs
phantoms_keep:boss/rb_goreThe Razorback - the tusks find you
phantoms_keep:boss/rb_overrunThe Razorback - it cannot stop
phantoms_keep:boss/rb_pawThe Razorback - it paws the ground
phantoms_keep:boss/rb_recoverThe Razorback - it gets its feet back
phantoms_keep:boss/regalia_archThe Regalia: Marginalia
phantoms_keep:boss/regalia_brodThe Regalia: Eight-Legged
phantoms_keep:boss/regalia_capstoneThe Court Adjourned - all twelve
phantoms_keep:boss/regalia_captThe Regalia: The Captain's Cuirass
phantoms_keep:boss/regalia_checkHas this player beaten all twelve?
phantoms_keep:boss/regalia_evokThe Regalia: Recusal
phantoms_keep:boss/regalia_guarThe Regalia: The List
phantoms_keep:boss/regalia_librThe Regalia: The Last Word
phantoms_keep:boss/regalia_masnThe Regalia: Set True
phantoms_keep:boss/regalia_miraThe Regalia: False Ground
phantoms_keep:boss/regalia_phanThe Regalia: The Hollow Crown
phantoms_keep:boss/regalia_razrThe Regalia: Tusk-Driver
phantoms_keep:boss/regalia_voidThe Regalia: The Weaver's Draw
phantoms_keep:boss/regalia_warpThe Regalia: Resin-Splitter
phantoms_keep:boss/ritualThe summoning ritual, one tick
phantoms_keep:boss/sign_bookLearn the name of whoever is standing here
phantoms_keep:boss/sonicThe Hollow Phantom's sonic scream
phantoms_keep:boss/stage2Any boss - second stage
phantoms_keep:boss/stage3Any boss - final stage
phantoms_keep:boss/summon_archivistSummon The Archivist
phantoms_keep:boss/summon_arch_evokerThe Arch-Evoker
phantoms_keep:boss/summon_broodmotherShe comes up out of the dark, and she is not a spider any more
phantoms_keep:boss/summon_gate_captainSummon The Gate-Captain
phantoms_keep:boss/summon_hollow_phantomSummon The Hollow Phantom
phantoms_keep:boss/summon_household_guardSummon The Household Guard
phantoms_keep:boss/summon_librarianSummon The Under-Librarian
phantoms_keep:boss/summon_masonSummon The Mason
phantoms_keep:boss/summon_mirage_masterThe Mirage Master
phantoms_keep:boss/summon_pale_wardenThe Pale Warden
phantoms_keep:boss/summon_razorbackSummon The Razorback
phantoms_keep:boss/summon_void_weaverThe Void Weaver
phantoms_keep:boss/tickBoss behaviour, one tick
phantoms_keep:boss/void_weaver_tickThe Void Weaver, per tick
phantoms_keep:boss/vw_displaceDISPLACE - he changes places with one of you
phantoms_keep:boss/vw_gapTHE GAP - what comes out of the slot the record never had
phantoms_keep:boss/vw_gatherGATHER - the room folds and everybody is suddenly close
phantoms_keep:boss/vw_threadTHREAD - a line pulled taut between him and you
phantoms_keep:boss/vw_thread_stepOne segment of the thread
phantoms_keep:bulb/checkRead the two rings off their own markers
phantoms_keep:bulb/faultLit out of turn, or a corner let go - the floor goes dark and the sky answers
phantoms_keep:bulb/fitFit markers to this keep's bulbs, upgrading the bulbs if they are old
phantoms_keep:bulb/outer_doneThe outer circle is complete
phantoms_keep:bulb/plateOne plate: shimmer while lit, speak when it first lights
phantoms_keep:bulb/plate_litThis plate has just come alight
phantoms_keep:bulb/solvedBoth circles burning - something answers the signal
phantoms_keep:bulb/spark_stepPut out what the bolt set alight, in this keep only
phantoms_keep:bulb/tickThe two circles in the upper arena
phantoms_keep:candle/checkIs there a candle on each of the four pads?
phantoms_keep:candle/solvedAll four corners lit - the watch is relieved
phantoms_keep:candle/tickThe four pads in the upper arena
phantoms_keep:candle/whisperThe room asks for light, without saying so
phantoms_keep:floor/armThe keep notices you standing on its signal floor
phantoms_keep:floor/doneThe whole floor is stone now
phantoms_keep:floor/fallThe boss is down, and the keep lets the boards back up
phantoms_keep:floor/rowsOne step of the wave - the two rows at distance d from the middle
phantoms_keep:floor/stepOne ring of the floor turns to stone
phantoms_keep:floor/tickThe signal floor arms itself when somebody comes up
phantoms_keep:floor/undoneWood again, and the keep waits to be left alone
phantoms_keep:floor/unrowsThe boards come back, from the outside in
phantoms_keep:floor/unstepOne ring of the floor goes back to wood
phantoms_keep:floor/voiceThe sound and dust of one step of the wave
phantoms_keep:keep/baconBacon picks a corner
phantoms_keep:keep/bacon_dropBacon
phantoms_keep:keep/bacon_findFind the floor under the chosen corner
phantoms_keep:keep/bacon_goneBacon is no longer in the ward
phantoms_keep:keep/death_vault/atGo to where they died, and find that keep's death vault
phantoms_keep:keep/death_vault/diedSomebody just died
phantoms_keep:keep/death_vault/fill_aHalf A - hotbar and the first eighteen inventory slots
phantoms_keep:keep/death_vault/fill_bHalf B - the rest of the inventory, the armour, the offhand, and whose it was
phantoms_keep:keep/death_vault/labelRead the owner's name back off the head
phantoms_keep:keep/death_vault/namePut the owner's name on the cell
phantoms_keep:keep/death_vault/overflowEvery cell is full
phantoms_keep:keep/death_vault/scanLook for a free cell, starting at the first
phantoms_keep:keep/death_vault/scan_stepHand the current cell number to the macro
phantoms_keep:keep/death_vault/scan_tryIs this cell free?
phantoms_keep:keep/death_vault/stripEverything landed - now take it off them
phantoms_keep:keep/death_vault/takeThis cell is free - take everything
phantoms_keep:keep/death_vault/tickHas anybody died who had not died a moment ago?
phantoms_keep:keep/guardpostThe Household Guard's post
phantoms_keep:keep/gusGus takes a different corner
phantoms_keep:keep/gus_findFind the floor under Gus's corner
phantoms_keep:keep/gus_goneGus is gone, and the household is counted
phantoms_keep:keep/gus_placeGus
phantoms_keep:keep/gus_postGus's yard, and the Guard's post beside it
phantoms_keep:keep/initSeed one keep's puzzle state on its own arena marker
phantoms_keep:keep/penThe pen goes up around Bacon
phantoms_keep:keep/wallowThe Razorback's wallow
phantoms_keep:loadPhantom Keep - one-time setup
phantoms_keep:lore/stockPut the keep's own books on its shelves
phantoms_keep:lore/stock_rollRoll two of the nine, independently
phantoms_keep:lore/tickStock any chiseled bookshelf that has not been stocked yet
phantoms_keep:rite/arch/doneThe record is in order
phantoms_keep:rite/arch/markAnother volume sits right
phantoms_keep:rite/arch/readSix slots, six volumes, in order
phantoms_keep:rite/arch/tickThe archive chamber, per tick
phantoms_keep:rite/arch/watchRead the shelf
phantoms_keep:rite/cells/clearedThe last of them stops moving
phantoms_keep:rite/cells/doneAll sixteen lit - and the cells empty at you
phantoms_keep:rite/cells/douse_onePut this candle block out WITHOUT flattening it
phantoms_keep:rite/cells/dressDecide which cell was never used, and wear the other three in
phantoms_keep:rite/cells/recountThe muster is recanted mid-fight
phantoms_keep:rite/cells/stateArmed, sprung, or paid?
phantoms_keep:rite/cells/tickThe hold, per tick
phantoms_keep:rite/cells/watchCount the candles, post by post
phantoms_keep:rite/heart/brokeSomebody has broken this heart
phantoms_keep:rite/heart/choosePick the heart that is his
phantoms_keep:rite/heart/doneAll four roots awake
phantoms_keep:rite/heart/drapeHang the strands back up
phantoms_keep:rite/heart/dripA bead of resin lets go
phantoms_keep:rite/heart/fightWhich heart is his, and has anybody broken it?
phantoms_keep:rite/heart/mossThe chamber before anything has happened
phantoms_keep:rite/heart/raiseSomebody cut the moss
phantoms_keep:rite/heart/rearmThe chamber is empty again
phantoms_keep:rite/heart/regrowThe roots close over again
phantoms_keep:rite/heart/slipNobody is keeping this vigil any more
phantoms_keep:rite/heart/stateWhich half of the rite is this chamber in?
phantoms_keep:rite/heart/stillDid this player move at all this tick?
phantoms_keep:rite/heart/stirThe root notices you
phantoms_keep:rite/heart/tickThe heart chamber, per tick
phantoms_keep:rite/heart/wakeThis heart is awake
phantoms_keep:rite/heart/watchOne chamber's four roots
phantoms_keep:rite/heart/woundThat was his
phantoms_keep:rite/heart/wrongThat one was not his
phantoms_keep:rite/hold/arenaSomebody lit the green set in the arena
phantoms_keep:rite/hold/arena_tickWatch the arena's green set
phantoms_keep:rite/hold/kindleThe soul fires take
phantoms_keep:rite/hold/markThe arena is named
phantoms_keep:rite/hold/nameOne arena is named, and it is guaranteed to belong to THIS keep
phantoms_keep:rite/hold/tickThe hold, per tick
phantoms_keep:rite/hold/watchAre all three green sets lit?
phantoms_keep:rite/proc/doneEvery stone is lit
phantoms_keep:rite/proc/douseEvery stone goes out
phantoms_keep:rite/proc/initFirst look at this chamber
phantoms_keep:rite/proc/lightThis stone lights, and stays lit
phantoms_keep:rite/proc/rearmNobody on the sigil
phantoms_keep:rite/proc/tickThe procession chamber, per tick
phantoms_keep:rite/proc/watchSomebody is on the sigil
phantoms_keep:spawn/cave_spiderOne cave spider, in the keep
phantoms_keep:spawn/dressDress anything that spawned in the keep since last second
phantoms_keep:spawn/hp_24Raise this mob to 24 health
phantoms_keep:spawn/hp_30Raise this mob to 30 health
phantoms_keep:spawn/hp_34Raise this mob to 34 health
phantoms_keep:spawn/hp_40Raise this mob to 40 health
phantoms_keep:spawn/jockeyThe rider on a spider
phantoms_keep:spawn/skeletonOne skeleton, kitted out
phantoms_keep:spawn/spiderOne spider, in the keep
phantoms_keep:spawn/tickSpawn dressing clock
phantoms_keep:spawn/zombie_villagerOne zombie villager, in the keep
phantoms_keep:tickPhantom Keep - per-tick atmosphere
phantoms_keep:zone/enterEntered the keep
phantoms_keep:zone/insideA player is inside the keep
phantoms_keep:zone/leaveLeft the keep
phantoms_keep:zone/musicMusic clock
phantoms_keep:zone/music_checkWho should be hearing the keep, and who should not any more
phantoms_keep:zone/music_leaveThis player has walked out of the keep - take the theme with them
phantoms_keep:zone/music_startStart one approach track
phantoms_keep:zone/tickZone clock
phantoms_keep:zone/whisperOne overheard fragment
phantoms_keep:zone/zone_checkOnce a second - who is inside?

Function Detail

armory

phantoms_keep:armory

Armoury clock
Within:

tag/function minecraft:tick

Desc:

THIS WAS THE MOST EXPENSIVE THING IN THE PACK. It ran

E[type=minecraft:

:armor_stand,tag=!armed,predicate=in_keep]
every tick - which walks every armour stand in every loaded chunk and evaluates a
structure lookup on each one. On a server where players build with armour stands
that is a real cost, paid forever, to do a job that only matters in the seconds
after a keep generates.
Once every 100 ticks (5s) is plenty: a stand that has just generated is not going
anywhere, and nobody notices a shield appearing five seconds after they walk in.

armory_blank

phantoms_keep:armory_blank

The High Seat's own empty bracket
Within:

function phantoms_keep:armory

Desc:

RACN: exactly ONE per armoury, not a roll. "Singular is the entire meaning. One
blank reads as an absence where a name should be. Several read as some shields
being unfinished." So it hangs off a marker baked into the piece - one marker,
one blank, structurally rather than statistically.
The Oathkeeper gave up his name the day he took the crown; a house with no name
bears no arms.

armory_one

phantoms_keep:armory_one

Arm one armour stand
Within:

function phantoms_keep:armory

Desc:

One d1000 roll for the weapon and one d6 for the house, so rarities are exact
"gold and below" - no diamond or netherite, though 26.x has spears in both.
1-15 mace (1.5%)
16-20 trident (0.5%)
21-1000 sword / axe / spear in wood, stone, copper, iron, gold
THE SIX OATH-BOUND HOUSES, from RACN's canon in lore_books/HERALDRY.md - the
pre-Sundering lords who swore at this keep, NOT the modern factions. Their arms
deliberately rhyme with Ironmark, Skarhold, Thalorwyn, Ashkar and Noctharin
without being them; RACN is explicit that the resonance must not be "corrected"
into a faction's actual banner.

armory_scan

phantoms_keep:armory_scan

Arm any new stands
Within:

function phantoms_keep:armory

armory_weapon

phantoms_keep:armory_weapon

Roll one weapon into a stand's hand
Within:

function phantoms_keep:armory_one, phantoms_keep:armory_blank

Desc:

Shared by BOTH arming paths. It lived inside armory_one, which meant the
blank-shield stand - armed by armory_blank and tagged before armory_one could
the blank shield... no weapons yet though."
ShowArms is set here too: without it an armour stand renders no held item at all,
so a stand can be correctly armed and still look empty.

atmosphere

phantoms_keep:atmosphere

Phantom Keep - gloom and fog for one player
Within:

function phantoms_keep:tick

Desc:

Drifting coloured haze, no screen effect. There is no per-structure fog in vanilla
- fog is a biome property - so this is how the keep gets its own weather without
needing a custom biome, which would have constrained where it can generate.

ambient

phantoms_keep:bell/ambient

The keep tolls its own answer at you
Within:

tag/function minecraft:tick

Desc:

The order is the puzzle; the rhythm deliberately is not. The five notes come in
1-2-3-4-5 every time, but at uneven gaps and with a long rest between passes, so a
player learns the SEQUENCE by listening and gets no help at all from the timing.
Copying the rhythm back would be impossible anyway - the bells are in different
towers.
Silent while a ritual or a boss is up: bell/toll owns the bells then, and two
loops ringing over each other reads as a bug rather than as atmosphere.
STOPS AT THE KILL, STARTS AGAIN NEXT VISIT.
The five tones are the puzzle telling you what it wants, so they run from the moment
you walk in. They stop while a boss is up - bell/toll owns the bells then - and they
stay stopped after he falls, because a hint you have already acted on is just noise.
phantoms_keep_masondone is cleared when the keep empties of players, so coming back
later starts the whole thing over. That keeps the encounter replayable without the
motif nagging at someone standing over the body.

ambient_step

phantoms_keep:bell/ambient_step

One tick of the ambient toll

130 ticks between notes: the note rings out, then ten ticks of silence, then the
next. 240 ticks of rest after the fifth, so a pass is clearly a pass rather than
an endless carillon. One cycle is 44 seconds.
amb_1

phantoms_keep:bell/amb_1

Ambient toll - note 1
Within:

function phantoms_keep:bell/ambient_step

Desc:

Rung from the bells themselves, so it arrives from the towers and moves as the
player moves between them, rather than sounding inside their head.

amb_2

phantoms_keep:bell/amb_2

Ambient toll - note 2
Within:

function phantoms_keep:bell/ambient_step

Desc:

Rung from the bells themselves, so it arrives from the towers and moves as the
player moves between them, rather than sounding inside their head.

amb_3

phantoms_keep:bell/amb_3

Ambient toll - note 3
Within:

function phantoms_keep:bell/ambient_step

Desc:

Rung from the bells themselves, so it arrives from the towers and moves as the
player moves between them, rather than sounding inside their head.

amb_4

phantoms_keep:bell/amb_4

Ambient toll - note 4
Within:

function phantoms_keep:bell/ambient_step

Desc:

Rung from the bells themselves, so it arrives from the towers and moves as the
player moves between them, rather than sounding inside their head.

amb_5

phantoms_keep:bell/amb_5

Ambient toll - note 5
Within:

function phantoms_keep:bell/ambient_step

Desc:

Rung from the bells themselves, so it arrives from the towers and moves as the
player moves between them, rather than sounding inside their head.

amb_reset

phantoms_keep:bell/amb_reset

End of a pass - rest, then begin again
Within:

function phantoms_keep:bell/ambient_step

fit

phantoms_keep:bell/fit

Give every bell near this player a hitbox, if it has not got one
Within:

function phantoms_keep:bell/tick, at a player, once every 100 ticks

Desc:

EVERY BELL, NOT ONE OF EACH. There are roughly a dozen bell_1 markers in a keep -
two bells hang in every tower topper - and any of them is a legitimate first note.
An earlier version used @e[tag=bell_1,limit=1,sort=nearest], which fitted exactly
one tower and left the rest of the keep dead.
PER-MARKER IDEMPOTENCE. Each summon is guarded by `unless entity` within 0.6 of
that marker, so a bell that already has a hitbox is skipped and one that does not
gets fitted. That makes the whole function safe to run on a loop: it converges and
then costs nothing. Two stacked hitboxes in one block would fire the state machine
twice for one swing and turn every correct strike into a wrong one - the same
shape as D62, so it is closed off here rather than left to discipline.
128 blocks reaches the far towers and the outer wall from anywhere inside the
keep, and cannot reach a neighbouring keep: the structure set spaces them 44
chunks apart.
Runs off the markers, so it is correct at any of the four placement rotations and
in keeps that generated under older builds - which is the whole reason this is a
runtime fit rather than something baked into the NBT.

ghast_arrive

phantoms_keep:bell/ghast_arrive

It heard you get it wrong
Within:

function phantoms_keep:bell/ghast_wait

Desc:

Six above the marker: a 4x4 mob needs the headroom, and it should come over the
parapet rather than out of the stonework.

ghast_wait

phantoms_keep:bell/ghast_wait

Hold the ghast back until the bell has spoken
Within:

function phantoms_keep:bell/tick

Desc:

Runs as one pending marker, at it. 45 ticks - two and a quarter seconds - clears
the strike and the loudest part of the six-second decay, so the note is heard in
full voice first and the ghast arrives into its tail. Long enough to separate the
two sounds, short enough that it still reads as the consequence of the mistake.

hit_1

phantoms_keep:bell/hit_1

Bell 1 was struck
Within:

function phantoms_keep:bell/struck, via `on attacker`

Desc:

EXECUTOR IS THE PLAYER. phantoms_keep_step is per-player, so two people can work
the puzzle at once without treading on each other.
`return run` IS LOAD-BEARING. This was an if/unless pair on phantoms_keep_step,
and right_1 SETS that score - so the second line re-read the value the first had
just changed, found it no longer 0, and called wrong on every CORRECT ring.
Returning ends the function before the fallthrough can be reached.
No stopsound any more. The interaction hitbox covers the bell block, so the swing
never reaches the block and vanilla never rings it - there is nothing to silence.

hit_2

phantoms_keep:bell/hit_2

Bell 2 was struck
Within:

function phantoms_keep:bell/struck, via `on attacker`

Desc:

EXECUTOR IS THE PLAYER. phantoms_keep_step is per-player, so two people can work
the puzzle at once without treading on each other.
`return run` IS LOAD-BEARING. This was an if/unless pair on phantoms_keep_step,
and right_2 SETS that score - so the second line re-read the value the first had
just changed, found it no longer 1, and called wrong on every CORRECT ring.
Returning ends the function before the fallthrough can be reached.
No stopsound any more. The interaction hitbox covers the bell block, so the swing
never reaches the block and vanilla never rings it - there is nothing to silence.

hit_3

phantoms_keep:bell/hit_3

Bell 3 was struck
Within:

function phantoms_keep:bell/struck, via `on attacker`

Desc:

EXECUTOR IS THE PLAYER. phantoms_keep_step is per-player, so two people can work
the puzzle at once without treading on each other.
`return run` IS LOAD-BEARING. This was an if/unless pair on phantoms_keep_step,
and right_3 SETS that score - so the second line re-read the value the first had
just changed, found it no longer 2, and called wrong on every CORRECT ring.
Returning ends the function before the fallthrough can be reached.
No stopsound any more. The interaction hitbox covers the bell block, so the swing
never reaches the block and vanilla never rings it - there is nothing to silence.

hit_4

phantoms_keep:bell/hit_4

Bell 4 was struck
Within:

function phantoms_keep:bell/struck, via `on attacker`

Desc:

EXECUTOR IS THE PLAYER. phantoms_keep_step is per-player, so two people can work
the puzzle at once without treading on each other.
`return run` IS LOAD-BEARING. This was an if/unless pair on phantoms_keep_step,
and right_4 SETS that score - so the second line re-read the value the first had
just changed, found it no longer 3, and called wrong on every CORRECT ring.
Returning ends the function before the fallthrough can be reached.
No stopsound any more. The interaction hitbox covers the bell block, so the swing
never reaches the block and vanilla never rings it - there is nothing to silence.

hit_5

phantoms_keep:bell/hit_5

Bell 5 was struck
Within:

function phantoms_keep:bell/struck, via `on attacker`

Desc:

EXECUTOR IS THE PLAYER. phantoms_keep_step is per-player, so two people can work
the puzzle at once without treading on each other.
`return run` IS LOAD-BEARING. This was an if/unless pair on phantoms_keep_step,
and right_5 SETS that score - so the second line re-read the value the first had
just changed, found it no longer 4, and called wrong on every CORRECT ring.
Returning ends the function before the fallthrough can be reached.
No stopsound any more. The interaction hitbox covers the bell block, so the swing
never reaches the block and vanilla never rings it - there is nothing to silence.

peal

phantoms_keep:bell/peal

Every bell at once
Within:

function phantoms_keep:boss/ritual

Desc:

The five notes together are a chord, not a melody - A, Bb, C#, D, E inside a
perfect fifth, which is deliberately not a nice one. Played at the ritual rather
than from the towers so it lands on the room the player is standing in.

readout

phantoms_keep:bell/readout

Say out loud what the game thinks just happened
Within:

function phantoms_keep:bell/hit_1 .. hit_5, BEFORE the right/wrong dispatch
If STRUCK does not match the lantern stack you aimed at, the ray is picking the
wrong bell. If it matches and NEEDED still differs, the sequence state is wrong.
Those are different bugs and this tells them apart in one ring.

right_1

phantoms_keep:bell/right_1

Bell 1 struck in sequence
Within:

function phantoms_keep:bell/hit_1

right_2

phantoms_keep:bell/right_2

Bell 2 struck in sequence
Within:

function phantoms_keep:bell/hit_2

right_3

phantoms_keep:bell/right_3

Bell 3 struck in sequence
Within:

function phantoms_keep:bell/hit_3

right_4

phantoms_keep:bell/right_4

Bell 4 struck in sequence
Within:

function phantoms_keep:bell/hit_4

right_5

phantoms_keep:bell/right_5

Bell 5 struck in sequence - the count is complete
Within:

function phantoms_keep:bell/hit_5

solved

phantoms_keep:bell/solved

Five bells, in order

- per-keep state;
Within:

function phantoms_keep:bell/right_5

Desc:

Reuses the altar's ritual machinery rather than summoning on the spot: the marker
carries the position and the countdown, and boss/ritual already owns the eighty
ticks of heartbeats, shrieks and - for a bells ritual - the motif accelerating
into a peal. Any trigger can drop that marker, which is why a puzzle can raise a
boss without a relic.
IT RISES OVER THE CANDLES. This first ran `summon ~ ~ ~` as the player, putting
the boss wherever they were standing when they struck the fifth bell. It now goes
to phantoms_keep_bell_spawn, a marker sitting one above the blackstone plinth in
the middle of main_keep's main room, ringed by the black candles - the room's
obvious focal point and six blocks of clear headroom.
Three targets in descending order of rightness, because a puzzle that silently
refuses to pay out is far worse than one that pays out in the wrong place:
the shrine, then any altar, then the player's own feet.
BOSS: The Mason. The bells hang in the towers he raised and refused to count,
so ringing them is what wakes him.

struck

phantoms_keep:bell/struck

A bell's hitbox was struck - name it, hand off to the player, then disarm it
Within:

function phantoms_keep:bell/tick

Desc:

EXECUTOR IS THE INTERACTION ENTITY, not the player. `on attacker` switches to
"the last player who attacked this entity", which is how the state machine gets
run as the right person.
ORDER IS DELIBERATE. The clear happens AFTER the hand-off, not before, because
`on attacker` resolves through the same attack record we would be deleting.
Clearing first would throw away the only pointer to who swung. Double-firing is
still impossible: both the dispatch and the clear happen inside one tick, so the
next tick's scan finds no attack data.
These five lines are plain `if`, NOT `return run`. That is correct here and it is
worth saying why, because the opposite mistake cost a day: `return run` is needed
when a branch REWRITES THE VALUE A LATER LINE TESTS. These test tags, hit_N never
touches tags, and the tags are mutually exclusive - so no branch can disturb
another. Using `return` here would be actively wrong, since it would skip the
clear on the last line and the bell would fire again every tick forever.
THE NULL-SCORE GUARD. `scoreboard objectives add` declares an objective; it does
NOT give any player a value. An unset score is not zero - it does not exist - and
`if score @s phantoms_keep_step matches 0` is FALSE against it. So a player who
has never rung a bell would fail hit_1 and be sent to wrong on their very first
strike, once each, forever. `add 0` creates the score at 0 if it is missing and
changes nothing if it is already there, so one cheap line closes it. It sits here
rather than in load because load cannot reach a player who joins later.

tick

phantoms_keep:bell/tick

The bell puzzle - has anyone struck a bell?
Within:

tag/function minecraft:tick

Desc:

ONE type-indexed selector pass over the keep's interaction entities, and an NBT
read only on those. Nothing happens at all until someone swings.
The fit runs on a 100-tick clock, not every tick. Bells do not move, so once a keep
is fitted every later pass finds nothing to do and costs one selector query per
five seconds. Doing it at runtime rather than baking hitboxes into the NBT means
keeps that generated under older builds get the puzzle too.

toll

phantoms_keep:bell/toll

The keep tolls while the boss stands
Within:

tag/function minecraft:tick

Desc:

Once the sequence is answered the towers ring it back, over and over, from the
bells themselves rather than to the player - so it comes from the towers wherever
you are, and moves as you move between them. It stops when the boss does.

toll_note

phantoms_keep:bell/toll_note

Ring the next bell in the sequence, from every tower that holds it
Within:

function phantoms_keep:bell/toll_step

toll_step

phantoms_keep:bell/toll_step

One beat of the toll
Within:

function phantoms_keep:bell/toll

Desc:

Same spacing as the hint - 130 ticks so each note rings out before the next, and
240 of silence between passes. The toll used a gap of 30, which meant four notes
sounding at once: a wash rather than a motif.

wrong

phantoms_keep:bell/wrong

Wrong bell - the count starts again
Within:

function phantoms_keep:bell/hit_1 .. hit_5

Desc:

The sequence resets to nothing, not to the note just struck. Striking bell 1 out
of order is still wrong; the player has to go back to a tower with bell 1 and
begin again, which is the whole reason the puzzle spans the towers.
NOTHING AUDIBLE HAPPENS HERE. The bells are six-second samples, and the ghast's
spawn scream was landing on top of the note the player had just struck - so the
one piece of information the puzzle gives you was being drowned by the punishment
for getting it wrong. The ghast is deferred to a marker instead; the immediate
feedback is visual, which reads underneath a ringing bell rather than over it.

adds

phantoms_keep:boss/adds

The Hollow Phantom calls its buddies
Within:

function phantoms_keep:boss/hollow_phantom_tick

Desc:

Small phantoms, tagged so they can be cleaned up with the boss and so they never
count as the boss for the slay advancement.

ae_conjure

phantoms_keep:boss/ae_conjure

SUMMONS - the court is called to order
Within:

function phantoms_keep:boss/arch_evoker_tick, as him, at him

Desc:

Capped at nine, counted first. Vexes fly and pass through walls, so an uncapped vex
boss is unfightable in a room with pillars in it - which this one has.

ae_contempt

phantoms_keep:boss/ae_contempt

CONTEMPT - passed on whoever is keeping their distance
Within:

function phantoms_keep:boss/arch_evoker_tick, as him, at him

Desc:

THE SENTENCE PUNISHES STANDING CLOSE, so without this the fight has an obvious answer:stay at range and plink. Contempt takes the FURTHEST player specifically, which means
there is no safe distance rather than merely no safe spot.
Glowing as well as wither, so everyone else can see who has been marked - it is a
court, and being held in contempt should be public.

ae_denied

phantoms_keep:boss/ae_denied

Somebody was standing on it
Within:

function phantoms_keep:boss/ae_recusal, at the chamber marker

ae_dim

phantoms_keep:boss/ae_dim

The room goes down with the sentence
Within:

function phantoms_keep:boss/ae_sentence, as him, at him

Desc:

Every lit bulb in the chamber, out at once. Positioned at the ARENA marker rather
than at him, because he moves and the sigil does not - dimming a box centred on the
boss would leave a lit crescent wherever he happened to be standing.
33x5x33 is 5445 blocks, well inside the fill limit, and it deliberately catches the
ward stones too. ae_relight puts the rite's own truth back afterwards.

ae_fangs

phantoms_keep:boss/ae_fangs

RING OF FANGS - the sigil's own geometry, used against you
Within:

function phantoms_keep:boss/arch_evoker_tick, as him, at him

Desc:

The fangs come up on DIAMOND rings, not circles, because that is the shape the mandala
under this fight is drawn in - the chamber and the move are the same geometry. Three
rings at four, eight and twelve, cast outward, so standing still in the middle is the
one thing that cannot work.
Fangs are summoned rather than cast, so they land where the sigil is rather than where
his pathing happens to point him.

ae_gavel

phantoms_keep:boss/ae_gavel

THE GAVEL - he strikes the record and the floor goes out under it
Within:

function phantoms_keep:boss/arch_evoker_tick, as him, at him

Desc:

EIGHT STONES, CHOSEN AT RANDOM, from the ones still lit. `limit=8,sort=random` does
the selection in the selector - no loop, no roll, no counter - and taking only lit
ones means a sigil already half out is not re-doused for nothing.
This is the move the whole fight now turns on. He regenerates while ANY stone is dark
(see arch_evoker_tick), so the Gavel is not damage - it is him buying himself time,
and the answer is to go and put the lights back on while he is trying to kill you.

ae_heal

phantoms_keep:boss/ae_heal

Twenty back
Within:

function phantoms_keep:boss/ae_mend, as him

Desc:

Read, add, clamp, write. `data modify` cannot do arithmetic, so the value goes out to a
score and comes back - and the clamp is what stops a long fight healing him past his
own maximum, which would leave the boss bar reading over full for ever.

ae_held

phantoms_keep:boss/ae_held

This one is held in contempt
Within:

function phantoms_keep:boss/ae_contempt, as the furthest player

ae_mend

phantoms_keep:boss/ae_mend

The centre was empty
Within:

function phantoms_keep:boss/ae_recusal, at the chamber marker

ae_recusal

phantoms_keep:boss/ae_recusal

RECUSAL - he withdraws to the centre of his own circle and mends
Within:

function phantoms_keep:boss/arch_evoker_tick, as him, at him

Desc:

THE COUNTER IS TO STAND ON THE SPOT. He heals twenty only if the sigil's centre is
empty when he reaches it, so the move teaches the room: hold the middle and he gets
nothing. That turns a heal into a positioning problem rather than a damage race.
Bounded to 24 and keyed on this chamber's own marker, so he cannot recuse himself to
another arena's sigil (D63).

ae_relight

phantoms_keep:boss/ae_relight

The room comes back up
Within:

function phantoms_keep:boss/arch_evoker_tick, as him, at him

Desc:

TWO STEPS, AND THE ORDER MATTERS. Relight everything, then re-douse the ward stones
whose score says they are out. A single fill would hand the player back a floor that
lies - stones lit that the rite believes are dark, or the Gavel's damage silently
undone. The marker score is the record; the block is only ever a picture of it.

ae_sentence

phantoms_keep:boss/ae_sentence

THE SENTENCE - passed on whoever is standing close enough to hear it
Within:

function phantoms_keep:boss/arch_evoker_tick, as him, at him

Desc:

Telegraphed a full second early by the witch particles in his tick, so it is a move to
step out of rather than a tax on being nearby. Blindness for three seconds and slowness
for five, not damage - the cost is that the fangs land while you cannot see them.

ae_snuff

phantoms_keep:boss/ae_snuff

One stone goes out
Within:

function phantoms_keep:boss/ae_gavel, as a ward marker, at it

Desc:

Mirrors rite/proc/light exactly, in reverse - the score is the record and the block
follows it, so a player re-lighting this stone gets the same treatment either way.

ae_vacate

phantoms_keep:boss/ae_vacate

VACATE THE FLOOR - fangs where each of you is standing
Within:

function phantoms_keep:boss/arch_evoker_tick, as him, at him

Desc:

His existing Ring of Fangs erupts around HIM, so it is answered by walking away. This
one erupts around YOU, so it is answered by moving - and the one second of warning in
arch_evoker_tick is what makes that fair rather than arbitrary.
`execute as ... at @s` per player rather than a single summon, because the fangs have
to land where each of them is, not where the nearest one is.

altar_gate

phantoms_keep:boss/altar_gate

Offering scan entry point
Within:

tag/function minecraft:tick

Desc:

Runs the scan UNCONDITIONALLY, and that is deliberate.
The guard was also unnecessary. `@e[type=item,...]` is resolved against the
entity-type index first, so the cost is proportional to the number of ITEM
ENTITIES loaded, not to world size, and the NBT test only runs on those. Three
such selectors per tick is not a cost worth breaking a feature for.
THROTTLED. altar_scan runs NINE @e[type=item,nbt={...}] selectors, and an NBT match
on an entity selector is one of the more expensive things a command can do - it walks
every item entity in loaded chunks and deep-compares a compound. Every tick was
indefensible for a check whose input is a player throwing an item on the floor.
Every 10 ticks - half a second. An offering sitting on an anchor is not going anywhere,
and half a second of delay before the ritual starts reads as the altar noticing rather
than as lag.

altar_gate_run

phantoms_keep:boss/altar_gate_run

The altar, twice a second
Within:

function phantoms_keep:boss/altar_gate

altar_idle

phantoms_keep:boss/altar_idle

Idle altar shimmer
Within:

function phantoms_keep:boss/altar_gate
obsidian just upside down or coming into the alter?"
So the tears run BACKWARDS - the altar drinks rather than weeps. reverse_portal
rises where crying obsidian's own particle falls, which is the upside-down read he
described, and soul flecks drift inward on top of it.
Runs as the baked-in altar marker, so it costs one tagged-entity selector and
needs no block scan. Suppressed while a ritual or a boss is up - the summon has
its own escalating effects and they should not compete.
both guards moved INSIDE the per-altar loop below and bounded to 128, the
keep-scoping radius. World-wide, a ritual or a boss anywhere silenced every idle altar
in the world - including keeps the player had never been to.
only near a player, so idle altars in unvisited arenas cost nothing to look at

altar_scan

phantoms_keep:boss/altar_scan

Is an offering resting on an altar?
Within:

function phantoms_keep:boss/altar_gate (which the tick tag calls)

Desc:

One line per summoning item. Matches the item entity by its custom_data - never by
its name, which a player can put on anything with an anvil - and requires it to be
is a different block state and a charged anchor explodes when used in the
Overworld, so charges=0 both matches his altar and refuses a booby-trapped one.
An item dropped on top of a block occupies the block space ABOVE it, so the anchor
is at ~-1 from the item, not at its own position.

altar_voice

phantoms_keep:boss/altar_voice

The altar, breathing
Within:

function phantoms_keep:boss/altar_idle

Desc:

Three vanilla layers at low volume, deliberately off-pitch so none of them is
recognisable on its own. AMBIENT channel, so it sits under music rather than
competing with it, and a player who has turned ambient sounds down loses it
rather than having it forced on them.

archivist_tick

phantoms_keep:boss/archivist_tick

The Archivist, one tick
Within:

function phantoms_keep:boss/tick

Desc:

She does not brawl. She blinks away, throws the record at you, and calls things
out of it - the fight is about closing distance rather than trading hits.

arch_evoker_tick

phantoms_keep:boss/arch_evoker_tick

The Arch-Evoker, per tick
Within:

function phantoms_keep:boss/boss_one, as him, at him

Desc:

SEVEN CLOCKS. Every tell reads its own score ABOVE the line that fires and clears it -
read before write, never safe-by-arithmetic (D62).
HE MENDS WHILE THE FLOOR IS DARK, and that is the spine of the fight now. The
Procession's 56 ward stones were lit by the player to call him; the Gavel puts eight
of them out; and for as long as any stone is dark he regenerates. His healing is
therefore not a timer to out-damage but a job to go and do, in the middle of
everything else he is throwing. Counting DARK stones rather than comparing against a
total keeps it to one selector and needs no cross-holder arithmetic.
Bounded to 24 - the chamber radius - so an Arch-Evoker in one arena cannot read or
douse another's sigil (D63).

arena_close

phantoms_keep:boss/arena_close

Bar the doorless entrance - the fight starts
Within:

function phantoms_keep:boss/ritual, at the moment a boss rises
wall; if you get all the way out, you walked through a door. Casting a ray every
degree from the altar marker across main_keep, seven of them stopped at a wall
10-18 blocks out (alcoves in a room that is not round) and exactly one reached the
edge of the structure - due south, through an arch at x 19-21, y 1-4, z 31. That
is the entrance with no door in it, and there is now a phantoms_keep_arena_gate
marker baked into main_keep.nbt sitting in it.
A CUBE, NOT A PANEL, AND THAT IS DELIBERATE. A keep is placed at one of four
rotations, so "three wide across the opening" is three wide along X in one keep and
along Z in the next - and `fill` takes no local (^) coordinates, so the panel
cannot simply be rotated. Filling ~-1..~1 on BOTH horizontal axes covers the arch
whichever way it faces, and `replace #minecraft:air` means only the hole is filled:
the surrounding stone is untouched and the result is the shape of the doorway, not
a block of bars.
Runs off markers, so /function phantoms_keep:boss/mark_gate can add more by hand
for keeps that generated before this build, and every one of them closes.

arena_open

phantoms_keep:boss/arena_open

The bars come down - nothing is left standing
Within:

function phantoms_keep:boss/cleanup

Desc:

Only bars this pack placed are removed, because the fill is bounded to the gate
markers and replaces iron_bars specifically. A player's own bars elsewhere in the
keep are never touched.
Lives in cleanup rather than in a death handler for the same reason the boss bar
does: cleanup runs unconditionally, so it still fires if the boss despawns, is
/killed, or the chunk unloads mid-fight. A lockdown you can be sealed inside
forever because the boss vanished is worse than no lockdown at all.

ar_blink

phantoms_keep:boss/ar_blink

Archivist - blink
Within:

function phantoms_keep:boss/archivist_tick

Desc:

Teleports onto the nearest player and drops two vexes there. Reappearing ON you
is what makes the vexes matter - they arrive already in melee.

ar_pages

phantoms_keep:boss/ar_pages

Archivist - page storm
Within:

function phantoms_keep:boss/archivist_tick

Desc:

Damage at range with no line-of-sight test, so cover does not save you - the
answer is to reach her. Blindness is 2s: disorientation, not a stun.

bacon_died

phantoms_keep:boss/bacon_died

Bacon is killed, and something in the ward hears it
Within:

advancement phantoms_keep:keep/slay_bacon, as the player who killed the piglet

Desc:

REVOKE FIRST. A vanilla advancement grants once and stays granted, so if any guard below
returned before the revoke, a kill in the wrong place would burn the trigger forever.
It reuses the ALTAR'S ritual marker rather than summoning on the spot, so the piglet route
gets the same four-second rise as the relic route. One animation, two doors into it.

bars

phantoms_keep:boss/bars

Boss bars
Within:

function phantoms_keep:boss/tick
within 64 blocks. `bossbar set <id> players` with NO argument clears the viewer
list, which is what hides the bar the moment the boss dies - there is no "hide"
command, and leaving a stale full bar on screen after a kill is worse than none.
The Hollow Phantom

bm_brood

phantoms_keep:boss/bm_brood

The brood - she is called the Broodmother for a reason
Within:

function phantoms_keep:boss/broodmother_tick, as her, at her

Desc:

CAPPED AT EIGHT, counted before anything is summoned. Without a cap a long fight
becomes a cave-spider tide and the frame rate decides the outcome; with it she can
always top the brood back up but never bury you.
Cave spiders at scale 0.7, so they read as HER young next to a 2.4-scale mother -
a cave spider is already the small one, and seven tenths of that is unmistakably
a juvenile. Their poison bite is thematically hers for free.
Two per cast, not four. The cap is still eight, so a long fight can still fill
the arena - it just takes four castings to get there instead of two.
Tagged phantoms_keep_add and phantoms_keep_add_broodmother, so boss/cleanup culls
them the moment she dies - the same contract the Archivist's and Mason's adds use.
A brood that outlived its mother would leave the arena permanently hostile.

bm_brood_step

phantoms_keep:boss/bm_brood_step

One broodling, glowing faintly green
Within:

function phantoms_keep:boss/tick, as a broodling, at it

Desc:

PARTICLES, NOT Glowing:1b. The glowing tag draws a hard team-coloured outline
through walls, which is a marker rather than a glow and reads as a debug overlay on
a mob this small. Two small dust particles a tick sit ON the body and fall off with
distance, which is what 'faint, not overly pronounced' actually looks like.
It also does real work: eight cave spiders in a dark arena are nearly invisible, and
the whole point of the brood is that you can see it coming down the walls.

bm_venom

phantoms_keep:boss/bm_venom

The venom - she rears, and the air goes green
Within:

function phantoms_keep:boss/broodmother_tick, as her, at her

Desc:

THE POISON, and it is a burst rather than an aura. An aura would be constant chip
damage nobody can answer; a burst on a 150-tick clock with a visible tell is a move
you learn to step out of.
Poison II for eight seconds inside eight blocks, which cannot kill on its own -
vanilla poison stops at half a heart - so it is pressure rather than a death
sentence, and it stacks with her bite into something that will.
Nausea only inside four. That is the melee band, and it is the difference between
fighting her at range and standing under her.

bm_web

phantoms_keep:boss/bm_web

She spits, and the floor grows a patch of web where you were standing
Within:

function phantoms_keep:boss/broodmother_tick, as her, at her

Desc:

AIMED AT A PLAYER, NOT AT HERSELF. `at @p` puts the cluster under whoever is
nearest, so the move is about where YOU are rather than about where she is - which
is what makes backing off the counter to it.
setblock ... KEEP, never replace. The arena floor is a puzzle: pressure plates,
copper bulbs, and after the conversion a stone floor the keep is proud of. `keep`
only writes into air, so a web can never eat a plate, a bulb, or a block of the
floor. It also means the web lands AROUND obstacles rather than through them.
EVERY CLUSTER CARRIES ITS OWN TIMER. A marker goes down with it and bm_web_step
clears the cluster when it runs out. Webs that outlive the fight would leave the
arena unusable for the next run and would sit on top of the signal floor for ever -
the same lesson the bookshelves taught.

bm_web_step

phantoms_keep:boss/bm_web_step

One web cluster, counting down to nothing
Within:

function phantoms_keep:boss/tick, as a web marker, at it

Desc:

Thirteen seconds, then it goes. Long enough to matter in a fight, short enough that
the arena is walkable again by the time the next move lands.
Clears by `fill ... replace minecraft:cobweb`, so it can only ever remove web - if
two clusters overlap, whichever expires second finds nothing left to do and that is
correct. Nothing else in the arena is touched.

book_archivist_1

phantoms_keep:boss/book_archivist_1

The Archivist - Edition I, the verdict
Within:

function phantoms_keep:boss/drop_archivist, as the player who landed the kill

Desc:

Always drops. This is the proof of the kill: the register entry, terse, in the court's
own hand. Editions II and III are the same case told at greater length.

book_archivist_2

phantoms_keep:boss/book_archivist_2

The Archivist - Edition II, the case
Within:

function phantoms_keep:boss/drop_archivist, as the player who landed the kill

Desc:

One in four. Who the Recorder was in life, and why the court could not let them go. This is
where the keep's story actually lives - the verdict alone tells you nothing.

book_archivist_3

phantoms_keep:boss/book_archivist_3

The Archivist - Edition III, the whole history, signed
Within:

function phantoms_keep:boss/drop_archivist, as the player, with storage phantoms_keep:book

Desc:

One in sixteen, and the only book in the pack that knows who you are. Fourteen pages
running from the High Seat to the Sundering to why the keep walks, and the reader is
written into the last four of them by name.
THE NAME COMES FROM boss/sign_book, which spawns a head stamped by fill_player_head,
reads minecraft:profile.name off it and kills it inside one tick. A player's name is
in their GameProfile and in no NBT the pack can reach, so there is no other route.

book_arch_evoker_1

phantoms_keep:boss/book_arch_evoker_1

The Arch-Evoker - Edition I, the verdict
Within:

function phantoms_keep:boss/drop_arch_evoker, as the player who landed the kill

Desc:

Always drops. This is the proof of the kill: the register entry, terse, in the court's
own hand. Editions II and III are the same case told at greater length.

book_arch_evoker_2

phantoms_keep:boss/book_arch_evoker_2

The Arch-Evoker - Edition II, the case
Within:

function phantoms_keep:boss/drop_arch_evoker, as the player who landed the kill

Desc:

One in four. Who the Convenor was in life, and why the court could not let them go. This is
where the keep's story actually lives - the verdict alone tells you nothing.

book_arch_evoker_3

phantoms_keep:boss/book_arch_evoker_3

The Arch-Evoker - Edition III, the whole history, signed
Within:

function phantoms_keep:boss/drop_arch_evoker, as the player, with storage phantoms_keep:book

Desc:

One in sixteen, and the only book in the pack that knows who you are. Fourteen pages
running from the High Seat to the Sundering to why the keep walks, and the reader is
written into the last four of them by name.
THE NAME COMES FROM boss/sign_book, which spawns a head stamped by fill_player_head,
reads minecraft:profile.name off it and kills it inside one tick. A player's name is
in their GameProfile and in no NBT the pack can reach, so there is no other route.

book_broodmother_1

phantoms_keep:boss/book_broodmother_1

The Broodmother - Edition I, the verdict
Within:

function phantoms_keep:boss/drop_broodmother, as the player who landed the kill

Desc:

Always drops. This is the proof of the kill: the register entry, terse, in the court's
own hand. Editions II and III are the same case told at greater length.

book_broodmother_2

phantoms_keep:boss/book_broodmother_2

The Broodmother - Edition II, the case
Within:

function phantoms_keep:boss/drop_broodmother, as the player who landed the kill

Desc:

One in four. Who the Warden of the Cells was in life, and why the court could not let them go. This is
where the keep's story actually lives - the verdict alone tells you nothing.

book_broodmother_3

phantoms_keep:boss/book_broodmother_3

The Broodmother - Edition III, the whole history, signed
Within:

function phantoms_keep:boss/drop_broodmother, as the player, with storage phantoms_keep:book

Desc:

One in sixteen, and the only book in the pack that knows who you are. Fourteen pages
running from the High Seat to the Sundering to why the keep walks, and the reader is
written into the last four of them by name.
THE NAME COMES FROM boss/sign_book, which spawns a head stamped by fill_player_head,
reads minecraft:profile.name off it and kills it inside one tick. A player's name is
in their GameProfile and in no NBT the pack can reach, so there is no other route.

book_gate_captain_1

phantoms_keep:boss/book_gate_captain_1

The Gate-Captain - Edition I, the verdict
Within:

function phantoms_keep:boss/drop_gate_captain, as the player who landed the kill

Desc:

Always drops. This is the proof of the kill: the register entry, terse, in the court's
own hand. Editions II and III are the same case told at greater length.

book_gate_captain_2

phantoms_keep:boss/book_gate_captain_2

The Gate-Captain - Edition II, the case
Within:

function phantoms_keep:boss/drop_gate_captain, as the player who landed the kill

Desc:

One in four. Who the Captain of the Outer Ring was in life, and why the court could not let them go. This is
where the keep's story actually lives - the verdict alone tells you nothing.

book_gate_captain_3

phantoms_keep:boss/book_gate_captain_3

The Gate-Captain - Edition III, the whole history, signed
Within:

function phantoms_keep:boss/drop_gate_captain, as the player, with storage phantoms_keep:book

Desc:

One in sixteen, and the only book in the pack that knows who you are. Fourteen pages
running from the High Seat to the Sundering to why the keep walks, and the reader is
written into the last four of them by name.
THE NAME COMES FROM boss/sign_book, which spawns a head stamped by fill_player_head,
reads minecraft:profile.name off it and kills it inside one tick. A player's name is
in their GameProfile and in no NBT the pack can reach, so there is no other route.

book_guard_1

phantoms_keep:boss/book_guard_1

The Household Guard - Edition I, the work order
Within:

function phantoms_keep:boss/drop_household_guard, as the player who landed the kill

Desc:

Always drops. Terse, in the steward's hand: the order that built it.

book_guard_2

phantoms_keep:boss/book_guard_2

The Household Guard - Edition II, the list
Within:

function phantoms_keep:boss/drop_household_guard

Desc:

Four in sixteen. The middle length: what actually happened to the list.

book_guard_3

phantoms_keep:boss/book_guard_3

The Household Guard - Edition III, the amendment
Within:

function phantoms_keep:boss/drop_household_guard with storage phantoms_keep:book

Desc:

One in sixteen, and the only edition that knows the reader's name - a macro function,
because a player's name lives in the GameProfile and in no NBT a datapack can reach.
sign_book puts it in storage first; without that this book is a load error, not a blank.

book_hollow_phantom_1

phantoms_keep:boss/book_hollow_phantom_1

The Hollow Phantom - Edition I, the verdict
Within:

function phantoms_keep:boss/drop_hollow_phantom, as the player who landed the kill

Desc:

Always drops. This is the proof of the kill: the register entry, terse, in the court's
own hand. Editions II and III are the same case told at greater length.

book_hollow_phantom_2

phantoms_keep:boss/book_hollow_phantom_2

The Hollow Phantom - Edition II, the case
Within:

function phantoms_keep:boss/drop_hollow_phantom, as the player who landed the kill

Desc:

One in four. Who the Absent Member was in life, and why the court could not let them go. This is
where the keep's story actually lives - the verdict alone tells you nothing.

book_hollow_phantom_3

phantoms_keep:boss/book_hollow_phantom_3

The Hollow Phantom - Edition III, the whole history, signed
Within:

function phantoms_keep:boss/drop_hollow_phantom, as the player, with storage phantoms_keep:book

Desc:

One in sixteen, and the only book in the pack that knows who you are. Fourteen pages
running from the High Seat to the Sundering to why the keep walks, and the reader is
written into the last four of them by name.
THE NAME COMES FROM boss/sign_book, which spawns a head stamped by fill_player_head,
reads minecraft:profile.name off it and kills it inside one tick. A player's name is
in their GameProfile and in no NBT the pack can reach, so there is no other route.

book_librarian_1

phantoms_keep:boss/book_librarian_1

The Librarian - Edition I, the verdict
Within:

function phantoms_keep:boss/drop_librarian, as the player who landed the kill

Desc:

Always drops. This is the proof of the kill: the register entry, terse, in the court's
own hand. Editions II and III are the same case told at greater length.

book_librarian_2

phantoms_keep:boss/book_librarian_2

The Librarian - Edition II, the case
Within:

function phantoms_keep:boss/drop_librarian, as the player who landed the kill

Desc:

One in four. Who the Keeper of the Count was in life, and why the court could not let them go. This is
where the keep's story actually lives - the verdict alone tells you nothing.

book_librarian_3

phantoms_keep:boss/book_librarian_3

The Librarian - Edition III, the whole history, signed
Within:

function phantoms_keep:boss/drop_librarian, as the player, with storage phantoms_keep:book

Desc:

One in sixteen, and the only book in the pack that knows who you are. Fourteen pages
running from the High Seat to the Sundering to why the keep walks, and the reader is
written into the last four of them by name.
THE NAME COMES FROM boss/sign_book, which spawns a head stamped by fill_player_head,
reads minecraft:profile.name off it and kills it inside one tick. A player's name is
in their GameProfile and in no NBT the pack can reach, so there is no other route.

book_mason_1

phantoms_keep:boss/book_mason_1

The Mason - Edition I, the verdict
Within:

function phantoms_keep:boss/drop_mason, as the player who landed the kill

Desc:

Always drops. This is the proof of the kill: the register entry, terse, in the court's
own hand. Editions II and III are the same case told at greater length.

book_mason_2

phantoms_keep:boss/book_mason_2

The Mason - Edition II, the case
Within:

function phantoms_keep:boss/drop_mason, as the player who landed the kill

Desc:

One in four. Who Hale Brann was in life, and why the court could not let them go. This is
where the keep's story actually lives - the verdict alone tells you nothing.

book_mason_3

phantoms_keep:boss/book_mason_3

The Mason - Edition III, the whole history, signed
Within:

function phantoms_keep:boss/drop_mason, as the player, with storage phantoms_keep:book

Desc:

One in sixteen, and the only book in the pack that knows who you are. Fourteen pages
running from the High Seat to the Sundering to why the keep walks, and the reader is
written into the last four of them by name.
THE NAME COMES FROM boss/sign_book, which spawns a head stamped by fill_player_head,
reads minecraft:profile.name off it and kills it inside one tick. A player's name is
in their GameProfile and in no NBT the pack can reach, so there is no other route.

book_mirage_master_1

phantoms_keep:boss/book_mirage_master_1

The Mirage Master - Edition I, the verdict
Within:

function phantoms_keep:boss/drop_mirage_master, as the player who landed the kill

Desc:

Always drops. This is the proof of the kill: the register entry, terse, in the court's
own hand. Editions II and III are the same case told at greater length.

book_mirage_master_2

phantoms_keep:boss/book_mirage_master_2

The Mirage Master - Edition II, the case
Within:

function phantoms_keep:boss/drop_mirage_master, as the player who landed the kill

Desc:

One in four. Who the Muster-Clerk was in life, and why the court could not let them go. This is
where the keep's story actually lives - the verdict alone tells you nothing.

book_mirage_master_3

phantoms_keep:boss/book_mirage_master_3

The Mirage Master - Edition III, the whole history, signed
Within:

function phantoms_keep:boss/drop_mirage_master, as the player, with storage phantoms_keep:book

Desc:

One in sixteen, and the only book in the pack that knows who you are. Fourteen pages
running from the High Seat to the Sundering to why the keep walks, and the reader is
written into the last four of them by name.
THE NAME COMES FROM boss/sign_book, which spawns a head stamped by fill_player_head,
reads minecraft:profile.name off it and kills it inside one tick. A player's name is
in their GameProfile and in no NBT the pack can reach, so there is no other route.

book_pale_warden_1

phantoms_keep:boss/book_pale_warden_1

The Pale Warden - Edition I, the verdict
Within:

function phantoms_keep:boss/drop_pale_warden, as the player who landed the kill

Desc:

Always drops. This is the proof of the kill: the register entry, terse, in the court's
own hand. Editions II and III are the same case told at greater length.

book_pale_warden_2

phantoms_keep:boss/book_pale_warden_2

The Pale Warden - Edition II, the case
Within:

function phantoms_keep:boss/drop_pale_warden, as the player who landed the kill

Desc:

One in four. Who the Warden of Roots was in life, and why the court could not let them go. This is
where the keep's story actually lives - the verdict alone tells you nothing.

book_pale_warden_3

phantoms_keep:boss/book_pale_warden_3

The Pale Warden - Edition III, the whole history, signed
Within:

function phantoms_keep:boss/drop_pale_warden, as the player, with storage phantoms_keep:book

Desc:

One in sixteen, and the only book in the pack that knows who you are. Fourteen pages
running from the High Seat to the Sundering to why the keep walks, and the reader is
written into the last four of them by name.
THE NAME COMES FROM boss/sign_book, which spawns a head stamped by fill_player_head,
reads minecraft:profile.name off it and kills it inside one tick. A player's name is
in their GameProfile and in no NBT the pack can reach, so there is no other route.

book_razorback_1

phantoms_keep:boss/book_razorback_1

The Razorback - Edition I, the stock book
Within:

function phantoms_keep:boss/drop_razorback, as the player who landed the kill

book_razorback_2

phantoms_keep:boss/book_razorback_2

The Razorback - Edition II, what it learned
Within:

function phantoms_keep:boss/drop_razorback

book_razorback_3

phantoms_keep:boss/book_razorback_3

The Razorback - Edition III, the last entry
Within:

function phantoms_keep:boss/drop_razorback with storage phantoms_keep:book

Desc:

One in sixteen, carries the reader's name via the macro. sign_book runs first.

book_void_weaver_1

phantoms_keep:boss/book_void_weaver_1

The Void Weaver - Edition I, the verdict
Within:

function phantoms_keep:boss/drop_void_weaver, as the player who landed the kill

Desc:

Always drops. This is the proof of the kill: the register entry, terse, in the court's
own hand. Editions II and III are the same case told at greater length.

book_void_weaver_2

phantoms_keep:boss/book_void_weaver_2

The Void Weaver - Edition II, the case
Within:

function phantoms_keep:boss/drop_void_weaver, as the player who landed the kill

Desc:

One in four. Who the Gap was in life, and why the court could not let them go. This is
where the keep's story actually lives - the verdict alone tells you nothing.

book_void_weaver_3

phantoms_keep:boss/book_void_weaver_3

The Void Weaver - Edition III, the whole history, signed
Within:

function phantoms_keep:boss/drop_void_weaver, as the player, with storage phantoms_keep:book

Desc:

One in sixteen, and the only book in the pack that knows who you are. Fourteen pages
running from the High Seat to the Sundering to why the keep walks, and the reader is
written into the last four of them by name.
THE NAME COMES FROM boss/sign_book, which spawns a head stamped by fill_player_head,
reads minecraft:profile.name off it and kills it inside one tick. A player's name is
in their GameProfile and in no NBT the pack can reach, so there is no other route.

boss_one

phantoms_keep:boss/boss_one

One boss, one branch
broodmother_tick

phantoms_keep:boss/broodmother_tick

The Broodmother, per tick
Within:

function phantoms_keep:boss/boss_one, as her, at her

Desc:

Three clocks, deliberately co-prime-ish so the moves do not land together and read
as one event: web at 90, venom at 150, brood at 260. Each is also gated on a player
actually being in range, so a boss nobody has reached does not spit at the wall.

call_archivist

phantoms_keep:boss/call_archivist

Altar offering: The Archivist

- per-keep state;
Within:

function phantoms_keep:boss/altar_scan
tossed onto the respawn anchor that consumes the special item and triggers the
boss fight."
Note `kill @s` refers to the ITEM, not a player - this function must never be
called from a player context or it would kill them.
CONTAINMENT: the altar only answers inside the keep.

call_arch_evoker

phantoms_keep:boss/call_arch_evoker

The Recused Totem goes on the anchor
Within:

function phantoms_keep:boss/altar_scan, as the offered item, at it

Desc:

Same contract as every other altar boss: refuse outside a keep, refuse while he
already stands, refuse while ANY ritual is running IN THIS KEEP, then consume the
offering and drop the ritual marker boss/ritual counts down.
The ritual guard is bounded to 128 - the keep-scoping radius - not world-wide, or a
fight in one keep would refuse every offering in another (D63).

call_broodmother

phantoms_keep:boss/call_broodmother

The Broodmother's Eye goes on the anchor
Within:

function phantoms_keep:boss/altar_scan, as the offered item, at it

Desc:

Same contract as the other four: refuse outside a keep, refuse while she already
stands, refuse while ANY ritual is running in this keep, then consume the offering
and drop the ritual marker that boss/ritual counts down.
The ritual guard is bounded to 128 - the keep-scoping radius - rather than being a
world-wide check, or a fight in one keep would refuse every offering in another.

call_gate_captain

phantoms_keep:boss/call_gate_captain

Altar offering: The Gate-Captain

- per-keep state;
Within:

function phantoms_keep:boss/altar_scan
tossed onto the respawn anchor that consumes the special item and triggers the
boss fight."
Note `kill @s` refers to the ITEM, not a player - this function must never be
called from a player context or it would kill them.
CONTAINMENT: the altar only answers inside the keep.

call_hollow_phantom

phantoms_keep:boss/call_hollow_phantom

Altar offering: The Hollow Phantom

- per-keep state;
Within:

function phantoms_keep:boss/altar_scan
tossed onto the respawn anchor that consumes the special item and triggers the
boss fight."
Note `kill @s` refers to the ITEM, not a player - this function must never be
called from a player context or it would kill them.
CONTAINMENT: the altar only answers inside the keep.

call_household_guard

phantoms_keep:boss/call_household_guard

Altar offering: The Household Guard
Within:

function phantoms_keep:boss/altar_scan

Desc:

RUNS AS THE DROPPED ITEM ENTITY, positioned at it. `kill @s` refers to the ITEM - this
function must never be called from a player context.
Guards copied from call_mason and they are all load-bearing: containment so an offering
cannot raise a boss in somebody's base, one-boss-at-a-time so the altar cannot stack
them, and one-RITUAL-at-a-time because the boss does not exist during its own four-second
summon - a boss-only guard let every tick of the ritual start another ritual.

call_librarian

phantoms_keep:boss/call_librarian

An Unshelved Volume goes on the anchor
Within:

function phantoms_keep:boss/altar_scan, as the offered item, at it

Desc:

HE WAS THE ONLY BOSS WITH NO RELIC. The copper plates in the main keep's upper chamber
were the sole way to call him, which made that one room mandatory in a pack where
every other fight has two doors into it.
Same contract as every other altar boss: refuse outside a keep, refuse while he already
stands, refuse while ANY ritual runs IN THIS KEEP, then consume the offering.
The ritual guard is bounded to 128 - the keep-scoping radius - not world-wide, or a
fight in one keep would refuse every offering in another (D63).

call_mason

phantoms_keep:boss/call_mason

Altar offering: The Mason

- per-keep state;
Within:

function phantoms_keep:boss/altar_scan
tossed onto the respawn anchor that consumes the special item and triggers the
boss fight."
Note `kill @s` refers to the ITEM, not a player - this function must never be
called from a player context or it would kill them.
CONTAINMENT: the altar only answers inside the keep.

call_mirage_master

phantoms_keep:boss/call_mirage_master

The False Glass goes on the anchor
Within:

function phantoms_keep:boss/altar_scan, as the offered item, at it

Desc:

Same contract as every other altar boss: refuse outside a keep, refuse while he
already stands, refuse while ANY ritual is running IN THIS KEEP, then consume the
offering and drop the ritual marker boss/ritual counts down.
The ritual guard is bounded to 128 - the keep-scoping radius - not world-wide, or a
fight in one keep would refuse every offering in another (D63).

call_pale_warden

phantoms_keep:boss/call_pale_warden

A Clot of Resin goes on the anchor
Within:

function phantoms_keep:boss/altar_scan, as the offered item, at it

Desc:

Same contract as every other altar boss: refuse outside a keep, refuse while he
already stands, refuse while ANY ritual is running IN THIS KEEP, then consume the
offering and drop the ritual marker boss/ritual counts down.
The ritual guard is bounded to 128 - the keep-scoping radius - not world-wide, or a
fight in one keep would refuse every offering in another (D63).

call_razorback

phantoms_keep:boss/call_razorback

Altar offering: The Razorback
Within:

function phantoms_keep:boss/altar_scan

Desc:

RUNS AS THE DROPPED ITEM ENTITY, positioned at it. `kill @s` refers to the ITEM - this
function must never be called from a player context.
Guards copied from call_mason and they are all load-bearing: containment so an offering
cannot raise a boss in somebody's base, one-boss-at-a-time so the altar cannot stack
them, and one-RITUAL-at-a-time because the boss does not exist during its own four-second
summon - a boss-only guard let every tick of the ritual start another ritual.

call_void_weaver

phantoms_keep:boss/call_void_weaver

A Thread of the Weave goes on the anchor
Within:

function phantoms_keep:boss/altar_scan, as the offered item, at it

Desc:

Same contract as every other altar boss: refuse outside a keep, refuse while he
already stands, refuse while ANY ritual is running IN THIS KEEP, then consume the
offering and drop the ritual marker boss/ritual counts down.
The ritual guard is bounded to 128 - the keep-scoping radius - not world-wide, or a
fight in one keep would refuse every offering in another (D63).

cleanup

phantoms_keep:boss/cleanup

Tear down after a boss dies

- per-keep state;
Within:

tag/function minecraft:tick

Desc:

THIS RUNS UNCONDITIONALLY, AND THAT IS THE WHOLE POINT. Teardown cannot live in
boss/bars, because bars is reached through boss/boss_one, which is
`as @e[tag=phantoms_keep_boss]` - it only runs while a boss is ALIVE. The
"clear the bar now the boss is gone" lines were sitting inside a function that
becomes unreachable at exactly the moment they are needed. The bar froze on
screen and the fight music kept playing, both forever, and no amount of killing
the boss could fix it because killing the boss is what stopped the code running.
A general rule this cost us: cleanup belongs on the always-on path, never inside
the thing being cleaned up after.
Bars are cleared per boss, so a second boss keeps its own bar while the first
one's disappears. `bossbar set <id> players` with NO argument empties the viewer
list, which hides it without deleting the bar itself.

drop_all_three

phantoms_keep:boss/drop_all_three

The Long Court Adjourned
Within:

advancement phantoms_keep:keep/all_three

Desc:

The capstone reward. One of these per world per player - all three bosses have to
be found, called and killed, so it cannot be stumbled into.

drop_archivist

phantoms_keep:boss/drop_archivist

The Archivist - kill reward
Within:

advancement phantoms_keep:keep/slay_archivist

Desc:

Runs as the player who landed the kill, so the drop is theirs.

drop_arch_evoker

phantoms_keep:boss/drop_arch_evoker

What is left of The Arch-Evoker
Within:

advancement phantoms_keep:keep/loot_arch_evoker

Desc:

REPEATABLE, and the revoke on the last line is what makes it so - a vanilla
advancement grants once per player and stays granted.

drop_broodmother

phantoms_keep:boss/drop_broodmother

What is left when she stops moving
Within:

advancement phantoms_keep:keep/loot_broodmother

Desc:

REPEATABLE, and the revoke on the last line is what makes it so. Vanilla
advancements grant once per player and stay granted, so without revoking itself
this would pay out exactly once per player for ever - which is the opposite of what
replayability wants.
Everyone who was in the fight gets the trophy; the killer gets the rest.

drop_gate_captain

phantoms_keep:boss/drop_gate_captain

The Gate-Captain - kill reward
Within:

advancement phantoms_keep:keep/slay_gate_captain

Desc:

Runs as the player who landed the kill, so the drop is theirs.

drop_guard_bar

phantoms_keep:boss/drop_guard_bar

The Household Guard - the bar it was made from
Within:

function phantoms_keep:boss/drop_household_guard

Desc:

Knockback II on a sword the player cannot enchant that way at a table without a book -
fitting for a thing built to push people back out of a gate.

drop_guard_core

phantoms_keep:boss/drop_guard_core

The Household Guard - what was beating inside it
Within:

function phantoms_keep:boss/drop_household_guard

Desc:

A heavy core: the rarest thing either ward boss gives, and the one that turns into a mace.

drop_guard_plate

phantoms_keep:boss/drop_guard_plate

The Household Guard - its plating
Within:

function phantoms_keep:boss/drop_household_guard

Desc:

Thorns on the chestplate rather than more protection: you inherit the thing that made it
unpleasant to stand next to.

drop_hollow_phantom

phantoms_keep:boss/drop_hollow_phantom

The Hollow Phantom - kill reward
Within:

advancement phantoms_keep:keep/slay_hollow_phantom

Desc:

Runs as the player who landed the kill, so the drop is theirs.

drop_household_guard

phantoms_keep:boss/drop_household_guard

The Household Guard - kill reward
Within:

advancement phantoms_keep:keep/loot_household_guard

Desc:

Runs as the player who landed the kill.
ONE ROLL, THREE PRIZES, odds readable at a glance: 10 / 10 / 20. Nested rolls would make
each prize quietly depend on missing the one before it.

drop_librarian

phantoms_keep:boss/drop_librarian

What the Under-Librarian leaves
Within:

advancement phantoms_keep:keep/loot_librarian, as the killer

Desc:

THE STAFF IS THE PRIZE, and it is rare on purpose - one kill in eight. Everything
else is consolation, so a run that does not roll it still pays for itself.
It drops through here rather than out of his hands: drop_chances is 0 on the mob so
the rarest item in the encounter is on a roll the pack controls, not on vanilla's
equipment coin flip.
Revoking the trigger at the end is what makes him farmable - a vanilla advancement
grants once per player and stays granted, so a reward attached to one pays out
exactly once in that player's life. See D-series for the same lesson learned
across all four earlier bosses.

drop_lib_boots

phantoms_keep:boss/drop_lib_boots

THE QUIET HOURS - what the staff was worn with
Within:

function phantoms_keep:boss/drop_librarian, on a 2-in-8 roll

Desc:

THESE ARE THE ANSWER TO HIS OWN BEST MOVE, and it is not a coincidence bolted on
afterwards - it falls straight out of how the silence window is measured.
lib_quiet_test sums walk_one_cm and sprint_one_cm. Crouching increments neither; it
has its own statistic, crouch_one_cm, which nothing here reads. So a player who
SNEAKS during QUIET IN THE STACKS moves without being counted as moving, and the
only thing wrong with that is how slowly sneaking goes. Swift Sneak III is the fix,
and it is the one enchantment in the game that exists to make crouching viable.
So his loot teaches you how to fight him. Kill him once and the second attempt is a
different encounter: you can reposition through the window instead of standing in
the open hoping the cage lands on somebody else.
Feather Falling because the upper arena is high and his recall pulls hard. Leather
and undyed on purpose - they are a librarian's indoor shoes, not armour, and they
should look like nothing at all.

drop_lib_staff

phantoms_keep:boss/drop_lib_staff

QUIETUS - the staff he carried
Within:

function phantoms_keep:boss/drop_librarian, on a 1-in-8 roll

Desc:

THE NAME DOES TWO JOBS AT ONCE. A quietus is the discharge of a debt and it is also
a release from life - and it opens with the word he shouts. He was owed nine books
and he is dead; there is not a better word in the language for that.
EPIC RARITY, which is a real component and not just a colour: minecraft:rarity set
to epic gives the light purple name vanilla uses for its own top tier, and keeps it
consistent with anything else in Elkonia that claims the same rank. The item_name
colour is set to match rather than left to chance.
LUNGE is the spear line's own enchantment - checked against the 26.2 registry, one
of 43, sitting alongside impaling and piercing. It belongs on this more than
sharpness would: he kept people at arm's length from his shelves for eleven years.
Mending and Unbreaking because it is the reward for a boss you can re-run. A prize
that degrades turns a rare drop into a consumable, and nobody farms a boss for a
consumable twice.

drop_lib_tome

phantoms_keep:boss/drop_lib_tome

The overdue notice
Within:

function phantoms_keep:boss/drop_librarian, on a 2-in-8 roll

Desc:

The consolation. An enchanted book, because the one thing he definitely had was books.

drop_mason

phantoms_keep:boss/drop_mason

The Mason - kill reward
Within:

advancement phantoms_keep:keep/slay_mason

Desc:

Runs as the player who landed the kill.
A vindicator has no head item in vanilla, so the trophy everyone who fought takes
home is his cornerstone instead - which suits a mason better than a skull would.
ONE ROLL, THREE PRIZES. A single 1..10 decides it: 1 the hammer, 2 a heavy core,
3 or 4 his tunic. One roll rather than nested ones because the odds should be
readable at a glance - 10 / 10 / 20 - and nesting makes each prize quietly depend
on missing the one before it.

drop_mason_core

phantoms_keep:boss/drop_mason_core

A heavy core - one kill in ten
Within:

function phantoms_keep:boss/drop_mason

Desc:

Otherwise vault-only, so this is the other way to a mace. Rare in its own right
rather than a consolation for missing the hammer.

drop_mason_hammer

phantoms_keep:boss/drop_mason_hammer

Hale Brann's Hammer - one kill in ten
Within:

function phantoms_keep:boss/drop_mason

Desc:

Density III and Knockback II. Density is the mace's own scaling; Knockback is what
he did to you all fight, so the hammer carries it across - you inherit the shove
rather than merely surviving it. Knockback is not a mace enchantment a player can
apply at a table, which is the point: it only exists on this one.

drop_mason_tunic

phantoms_keep:boss/drop_mason_tunic

Hale Brann's Tunic - one kill in five
Within:

function phantoms_keep:boss/drop_mason

Desc:

A working mason's tunic, not armour off a soldier. Leather dyed the grey of
unweathered stone, Protection II and Unbreaking III - it will not carry a fight,
but it lasts, which is the whole of what he was proud of.
More common than the hammer or the core, because it is the thing he actually wore
every day rather than the thing he was famous for.

drop_mirage_master

phantoms_keep:boss/drop_mirage_master

What is left of The Mirage Master
Within:

advancement phantoms_keep:keep/loot_mirage_master

Desc:

REPEATABLE, and the revoke on the last line is what makes it so - a vanilla
advancement grants once per player and stays granted.

drop_pale_warden

phantoms_keep:boss/drop_pale_warden

What is left of The Pale Warden
Within:

advancement phantoms_keep:keep/loot_pale_warden

Desc:

REPEATABLE, and the revoke on the last line is what makes it so - a vanilla
advancement grants once per player and stays granted.

drop_razorback

phantoms_keep:boss/drop_razorback

The Razorback - kill reward
Within:

advancement phantoms_keep:keep/loot_razorback

Desc:

Runs as the player who landed the kill. Same 10 / 10 / 20 shape as every other boss here.

drop_razorback_cleaver

phantoms_keep:boss/drop_razorback_cleaver

The Razorback - the tusk, sharpened
Within:

function phantoms_keep:boss/drop_razorback

drop_razorback_heart

phantoms_keep:boss/drop_razorback_heart

The Razorback - what kept it running
Within:

function phantoms_keep:boss/drop_razorback

Desc:

Three golden apples rather than one enchanted: the rare drop should be generous, not a
fight-ender you hoard for a different boss entirely.

drop_razorback_hide

phantoms_keep:boss/drop_razorback_hide

The Razorback - its hide
Within:

function phantoms_keep:boss/drop_razorback

Desc:

Dyed to the boar's own colour, and fire protected: it slept against the forge wall.

drop_void_weaver

phantoms_keep:boss/drop_void_weaver

What is left of The Void Weaver
Within:

advancement phantoms_keep:keep/loot_void_weaver

Desc:

REPEATABLE, and the revoke on the last line is what makes it so - a vanilla
advancement grants once per player and stays granted.

engage

phantoms_keep:boss/engage

This player has drawn blood - they are in the fight now
Within:

advancement phantoms_keep:keep/engaged, as the player who landed the hit

Desc:

phantoms_keep_fought was the obvious tag to reuse and it is the wrong one: it means
"stood within 24 blocks", not "hit him", and nothing ever clears it - a player who
once walked past a boss carries it forever. This tag means what it says.
THE DEATH BASELINE IS TAKEN HERE, not at boss spawn. deathCount only ever climbs,
so comparing it against a snapshot from the moment they engaged is what turns "has
died at some point" into "has died since joining THIS fight". Without the snapshot
a player who had ever died would open the gate the instant they swung.

fight_music

phantoms_keep:boss/fight_music

Whose track should this player be hearing?
Within:

function phantoms_keep:boss/boss_one

Desc:

A TAG, NOT THE SHARED COUNTER. Gating on `phantoms_keep_music matches 1..` would read
the same counter the AMBIENT keep track sets to 3600 on entry, so a player who arrived
during ambient music could not start a fight track for up to three minutes, and the
fight track would then begin underneath an ambient one still playing.
phantoms_keep_battle is a separate, honest flag: "this player is currently on a
fight track". It cannot be confused with the ambient countdown, so the switch is
immediate and happens exactly once.

fight_music_start

phantoms_keep:boss/fight_music_start

SILENCE THE KEEP FIRST. music.keep is a `record` sound - once started it runs to
the end on its own, so starting a fight track without stopping it layers the two.
The tag goes on here so the switch happens once per player per fight.
fight_music_stop

phantoms_keep:boss/fight_music_stop

The fight is over - hand the room back to the keep
Within:

function phantoms_keep:boss/cleanup, as a player who was on a fight track

Desc:

ONE TRACK AT A TIME, IN BOTH DIRECTIONS. Going in, fight_music_start stops
music.keep before it starts a fight track. Coming out, this stops the fight track
and starts music.keep again. Neither transition leaves two records spinning.
Every boss track is stopped BY NAME rather than with a bare `stopsound @s`, so
this cannot silence a player's own jukebox, a note block, or anything else they
have going - only the four fight tracks this pack starts.
THE RESTART IS IMMEDIATE, not left to zone/music_check. That check runs on a
200-tick clock, so waiting for it would leave up to ten seconds of dead air
between the last hit and the keep coming back - which reads as the music being
broken rather than as a breath. Calling music_start here makes the handover land
on the kill.
It is guarded on actually being in the keep, so a player who fought a boss and
then walked out does not get the keep's theme started in a field somewhere.

gate_captain_tick

phantoms_keep:boss/gate_captain_tick

The Gate-Captain, one tick
Within:

function phantoms_keep:boss/tick

Desc:

Slam on a short cooldown, guards on a long one. He held a gate for a living and
he fights like it - he does not chase, he makes standing near him expensive.

gc_guards

phantoms_keep:boss/gc_guards

Gate-Captain - call the watch
Within:

function phantoms_keep:boss/gate_captain_tick

Desc:

Two wither skeletons, capped at four alive so a long fight does not turn into a
mob pit. Tagged as adds, so boss/cleanup takes them with him when he falls.

gc_slam

phantoms_keep:boss/gc_slam

Gate-Captain - shield slam
Within:

function phantoms_keep:boss/gate_captain_tick

Desc:

A ring of damage and a hard shove. Radius 5, so it punishes standing next to him
rather than being in the room - there is somewhere to be that is not in range.

hg_rivet

phantoms_keep:boss/hg_rivet

The Household Guard - it throws a rivet
Within:

function phantoms_keep:boss/household_guard_tick, only when nobody is within seven

Desc:

THE ANTI-CAMPING MOVE, and the condition on it is the whole point: it only fires when
every player is out of melee. A slow boss with no reach can be shot to death from twelve
blocks with no risk whatsoever, which would make the vent rhythm irrelevant.
It hits ONE player, the nearest - this is a thrown bolt, not a barrage, and a boss that
reliably tags everyone at range would push the fight back into melee for the wrong reason.

hg_stamp

phantoms_keep:boss/hg_stamp

The Household Guard - the stamp
Within:

function phantoms_keep:boss/household_guard_tick

Desc:

The answer to hiding in a doorway. Short range, so it only fires when somebody is already
close - standing behind a wall is a respite, not a solution.
Mining fatigue rather than more damage. Being unable to swing properly for four seconds
next to a boss with twelve armour is worse than losing four hearts, and it teaches the
lesson the fight is built on: do not trade with it outside the vent.

hg_sweep

phantoms_keep:boss/hg_sweep

The Household Guard - the sweep
Within:

function phantoms_keep:boss/household_guard_tick

Desc:

A wide arm sweep that clears the lane. Almost no damage - three - because this move is
about POSITION. It throws everyone out to eight blocks, which is exactly far enough that
walking back in costs you the rest of the vent window if you were standing in it.
Eight wind charges in a ring rather than six, because the ward's lanes are wider than the
Mason's hall and a sparse ring leaves gaps you can stand in by luck rather than by reading.

hg_vent

phantoms_keep:boss/hg_vent

The Household Guard - the plates open
Within:

function phantoms_keep:boss/household_guard_tick

Desc:

THIS IS THE FIGHT. Armour 12 to 0 for eight seconds. Everything the Guard does between
vents is designed to make sure you are not already standing in the right place when it
happens - the sweep throws you out, the stamp punishes waiting close, the rivet punishes
waiting far.
IT ANNOUNCES ITSELF, loudly and for a full second before the armour drops. An unmissable
tell is what turns a timer into a rhythm; a window you can only find by watching a health
bar is a window most players never find at all.
Glowing so it reads through a house wall - the ward is full of buildings now and losing
the boss behind one during its only vulnerable window would be maddening rather than hard.

hg_vent_end

phantoms_keep:boss/hg_vent_end

The Household Guard - the plates shut
Within:

function phantoms_keep:boss/household_guard_tick

Desc:

Armour back, counter cleared. Stage two and three do NOT raise the armour again on top of
this - they shorten the gap between vents instead, which makes the fight faster without
making the window smaller. A boss that gets harder by removing your only opening is a
boss that stops being beatable rather than one that gets harder.

hollow_phantom_tick

phantoms_keep:boss/hollow_phantom_tick

The Hollow Phantom, one tick
Within:

function phantoms_keep:boss/tick

Desc:

Two abilities on independent cooldowns held as scoreboard values on the boss
itself, so several bosses could run at once without sharing timers.

household_guard_tick

phantoms_keep:boss/household_guard_tick

The Household Guard, one tick
Within:

function phantoms_keep:boss/boss_one

Desc:

Three timers and a state. The VENT is the fight, so it runs on the longest clock and
everything else is spaced to stop you standing in it for free.
WHY THE VENT IS TRACKED AS A COUNTER RATHER THAN A TAG. It has to end, and it has to end
even if the player leaves, the chunk reloads, or the boss is hit by something that clears
tags. A counter that runs to a number cannot get stuck open, which a tag can.

hp_gale

phantoms_keep:boss/hp_gale

Hollow Phantom - wing gale
Within:

function phantoms_keep:boss/hollow_phantom_tick

Desc:

A downbeat of the wings that throws everyone near it upward. LEVITATION rather
than knockback: knockback applied from a command is unreliable against a player,
levitation always reads, and the fall afterwards is the actual threat.

librarian_tick

phantoms_keep:boss/librarian_tick

The Under-Librarian, per tick
Within:

function phantoms_keep:boss/boss_one, as the boss, at him

Desc:

Four timers, all out of phase with the Mason's so the two never settle into the
same rhythm.
quiet 260 the silence window opens
shelving 400 he files somebody, and the shelf catches
fangs 130 a line down the floor
shout 200 a line of dialogue
throw 200+ three books, drifting - then a random 0-300 tick delay on
top, so it never lands on a countable beat
bolt 70 one arm off the staff, only at range 3-24 - he does not
shoot someone standing on top of him
THE PUNISH CHAIN IS ITS OWN CLOCK, started by lib_caught rather than by a timer,
because it is a reaction and not part of a rotation:
t=0 I SAID SILENCE
t=12 RECALL - everyone dragged in, so nobody sits out the warning
t=30 the stars - the eight bearings drawn faintly
t=48 the blast, down those exact lines
The ordinary timers keep running through it. He can be mid-punish and still lay
fangs; he is angry, not busy.

lib_blast

phantoms_keep:boss/lib_blast

The blast - eight arms of the plates' own light
Within:

function phantoms_keep:boss/lib_caught, at the boss

Desc:

EIGHT, AND THEY ARE THE PRESSURE PLATES' SHIMMER. Same soul-fire blue, same end-rod
sparks, same cyan dust as the columns standing on the lit plates - so the thing
that answered the puzzle is the thing he throws at you. The Gong is thirty-two arms
of gold and black; this is eight of cold blue. They should never be mistaken for
each other across a room.
45 degrees apart and no spin. The Gong spirals because it is a sound rolling
outward; this is a librarian pointing in eight directions at once, and it should
look sharp rather than swept.

lib_blast_hit

phantoms_keep:boss/lib_blast_hit

An arm of silence caught a player
Within:

function phantoms_keep:boss/lib_blast_step, as the struck player

Desc:

sonic_boom typed, so armour does not soak it - the same reasoning vanilla uses for
the warden, and the same as the Gong. Deafness rather than a stun: he has made his
point and you can still fight.

lib_blast_step

phantoms_keep:boss/lib_blast_step

One step of a silence arm
Within:

function phantoms_keep:boss/tick, as each phantoms_keep_lib_blast marker

Desc:

Straight, fast and short: 0.8 a tick out to 16 blocks in a second. The Gong is slow
and wide because you are meant to read it and move; this is the punishment for
having already moved, so it should land before you can do much about it.
One hit per blast, tagged, or a player standing where two arms cross takes it twice
for one mistake.

lib_bolt

phantoms_keep:boss/lib_bolt

He levels the staff and one arm of it goes out
Within:

function phantoms_keep:boss/librarian_tick, as the boss, at him

Desc:

The staff is a diamond spear and this is what it does: a single arm of the same
blue the plates burn with, aimed rather than sprayed. The eight-arm blast is his
punishment for noise; this is just how he attacks, and it is the reason he can hold
a room at range while moving at 0.28.
ONE ARM, REUSING THE BLAST'S OWN STEP. It carries phantoms_keep_lib_blast so
lib_blast_step drives it - same speed, same particles, same damage, same tearing
through cage walls. A separate near-identical stepper would be two things to keep
in sync for no gain.
`tp ... facing entity` is what aims it. `execute facing` sets the execution facing,
not the entity's rotation, so it cannot point a marker at anything - the rotation
has to be written by the tp itself.

lib_book_hit

phantoms_keep:boss/lib_book_hit

A book found somebody
Within:

function phantoms_keep:boss/lib_book_step, as the struck player, AT THE BOOK

Desc:

One hit point and one block of shove. Three of these land at once and they come
every four and a half seconds - they are punctuation, not a damage source. What
they actually do is spoil your footing, which matters enormously in a fight where
standing still is the safe option and he is about to demand silence.
THE CALLER DOES NOT `at @s`, DELIBERATELY. This runs positioned at the BOOK, not at
the player, which is the only way to shove someone away from the thing that hit
them: face the player from the book, step forward, and that vector points outward.
Taking the position from the player instead would give a push relative to nothing.
Natural knockback would be wrong here too - `damage ... by` throws you away from
the BOSS, who may be across the room, so a book to the back of the head would pull
you toward the thrower.
The book is killed by a separate selector rather than `kill @s`, because @s is the
player. That mistake is one character away and would read as an unexplained death.

lib_book_miss

phantoms_keep:boss/lib_book_miss

A book hit a wall, or ran out of patience
Within:

function phantoms_keep:boss/lib_book_step, as the book

lib_book_step

phantoms_keep:boss/lib_book_step

One thrown book, in flight
Within:

function phantoms_keep:boss/tick, as each phantoms_keep_lib_book, at it

Desc:

It homes. `facing entity` then a forward tp is the same trick his fang line, his
recall and the Gong's arms all use - the only way to build a vector toward
something without doing the arithmetic by hand.
IT DRIFTS. 0.15 a tick is three blocks a second - slower than walking, so a book
never really chases you down. It follows. You can outpace one all day and still
have to think about where the three of them are while he is doing something else,
which is the whole job: they are furniture in the fight, not a threat on their own.
200 ticks of life at that speed is about thirty blocks of travel, enough to cross
the arena twice before it gives up.
NoGravity is not set: the tp each tick overrides the fall anyway, and leaving
gravity on means a book that loses its target drops and lies there rather than
hanging in the air.
lib_book_hit is called WITHOUT `at @s` on purpose: it needs to stay positioned at
the book so it can shove the player away from it.
It dies on contact, on hitting a wall, or after 60 ticks - three ways out, so no
book can end up circling the arena forever if its target logs off mid-flight.

lib_cage_burn

phantoms_keep:boss/lib_cage_burn

Caught inside when the bolt landed
Within:

function phantoms_keep:boss/lib_cage_step, at t=26, as the trapped player

Desc:

THE BOLT DOES THE DAMAGE, not this. A lightning bolt deals 5 HP and ignites
whatever it catches, all on its own, so an extra damage command here would be
double-charging for one hit. What is left is the part vanilla will not do: making
sure the burn is long enough to matter, and saying so.
Four seconds of fire. Survivable in any sensible armour, genuinely frightening at
low health, and answerable - water, a fire-resistance potion, or simply breaking a
shelf and getting out are all real outs.

lib_cage_clear

phantoms_keep:boss/lib_cage_clear

The cage is done - take all of it back
Within:

function phantoms_keep:boss/lib_cage_step, as the marker, at it

Desc:

EVERYTHING, INCLUDING THE FIRE. Bookshelves back to air, and a wider box for the
fire because a burning shelf can light the block beside it. The fire box is one
block bigger in every direction than the cage ever was.
Set to air rather than broken, so no charred bookshelves drop as loot and nothing
is left burning after he is dead.

lib_cage_step

phantoms_keep:boss/lib_cage_step

One tick of a shelving cage
Within:

function phantoms_keep:boss/tick, as each phantoms_keep_lib_cage marker, at it

Desc:

t=1 four walls of bookshelves go up around the spot
t=20 he tells you why
t=26 A LIGHTNING BOLT lands on the cage and lights it
t=90 everything is gone, down to the ash
THE BOLT IS THE IGNITION, and using a real one does three jobs at once: it lights
the shelves, it deals its own 5 HP, and it sets the player alight - all vanilla, no
hand-rolled damage command pretending to be lightning. Java has no cosmetic
lightning flag, so summoning one always brings the whole package; here the whole
package is exactly what is wanted.
IT IS ALSO WHY THE FLOOR IS STONE. A bolt starts fires in a two-block radius, and
this lands in the middle of the room every twenty seconds. On the arena as it
generates - a wooden checkerboard - that would spread across the floor and go on
burning after he was dead. The pre-puzzle turns it to deepslate, cinnabar and
basalt before a single plate is pressed, and this is the move that makes that
necessary rather than decorative.
FOUR WALL FILLS, NOT ONE HOLLOW BOX. `fill ... hollow` would include a floor and a
ceiling, burying the player in their own cage and sealing the top. Four side walls
leave it open above: escapable by climbing, by breaking a shelf, or by eating the
fire and walking out.
Every fill is `replace #minecraft:air`, so the cage cannot cut into the arena's own
blocks, a pillar or a copper bulb. The lone setblock uses `keep` for the same
reason - setblock takes a MODE, not a filter, so `replace #minecraft:air` is fill
syntax and will not parse there.
IT CLEANS UP AT t=90 WHATEVER HAPPENED - not on the boss dying, not on the player
leaving, but on its own clock. The marker outlives him precisely so the clear still
runs if he dies mid-cage. A fire the pack lit and forgot is the one outcome worth
engineering against.

lib_caught

phantoms_keep:boss/lib_caught

Somebody moved
Within:

function phantoms_keep:boss/lib_quiet_test, as the offender

Desc:

The window shuts the instant anyone is caught, so one careless player ends it for
the room - which is the point in a group. The blast comes from HIM, not from the
person who moved: he is the one who is angry.

lib_dark

phantoms_keep:boss/lib_dark

The room takes its light back

- per-keep state;
Within:

function phantoms_keep:boss/ritual, at ritual tick 10, librarian only

Desc:

You have just spent the whole puzzle putting light INTO this room - four corners,
then sixteen - and the first thing it does with a full set of lamps is put them
all out. That inversion is the point: the reward for lighting the signal floor is
finding out what the floor was signalling to.
The bulbs go out by setblock rather than by toggling, so it is absolute, and the
darkness effect covers the gap where a player would otherwise still see by the
glow of the glazed terracotta and the lanterns in the walls.
Long enough to hide the shelves going up - they land at tick 30, twenty ticks into
a five-second blackout - and short enough that nobody thinks the game has frozen.

lib_fangs

phantoms_keep:boss/lib_fangs

A line of fangs down the floor
Within:

function phantoms_keep:boss/librarian_tick

Desc:

The evoker trick the design note asked for, on a body that is not an evoker. Eight
fangs walking away from him toward the nearest player, one every other block, which
is the vanilla spacing - so it reads as the real spell rather than an approximation.
A marker does the walking. evoker_fangs cannot be aimed by NBT, so the only way to
lay a line is to move a position along a bearing and summon at each step, which is
exactly what the Gong's arms do.

lib_fang_step

phantoms_keep:boss/lib_fang_step

One step of the fang line
Within:

function phantoms_keep:boss/tick, as each phantoms_keep_lib_fang marker

lib_quiet

phantoms_keep:boss/lib_quiet

QUIET IN THE STACKS - he calls for silence, and means it
Within:

function phantoms_keep:boss/librarian_tick, as the boss, at him

Desc:

THE EXACT INVERSE OF THE MASON. That fight punishes standing still - the smash
throws you off, the Gong catches you running back. This one punishes moving. Two
bosses in one keep should not want the same thing from you.
A four-second window opens. Anyone who takes a step inside it gets the blast, and
the blast is the pressure plates' own blue shimmer thrown out in eight directions -
so the thing that answered the puzzle is the thing he hits you with.
MOVEMENT IS MEASURED, NOT GUESSED. walk_one_cm and sprint_one_cm are vanilla
statistics in centimetres, so a snapshot at the start of the window and a
comparison during it is exact and costs two scoreboard reads. Position-diffing
every player every tick would be both heavier and worse: it cannot tell a step from
being shoved, and being shoved by his own recall should not be a death sentence.
Twenty centimetres of slack. Enough to swallow knockback, a slab step and the
jitter of standing on a pressure plate; far short of a deliberate move.

lib_quiet_mark

phantoms_keep:boss/lib_quiet_mark

Snapshot how far this player has walked so far
Within:

function phantoms_keep:boss/lib_quiet, as each player in the room

Desc:

walk and sprint are separate vanilla statistics, so both are summed - otherwise a
player could sprint the whole window without the walk counter moving at all.

lib_quiet_open

phantoms_keep:boss/lib_quiet_open

Open the silence window
Within:

function phantoms_keep:boss/librarian_tick

lib_quiet_test

phantoms_keep:boss/lib_quiet_test

Has this player moved during the silence?
Within:

function phantoms_keep:boss/lib_quiet_watch, as one hushed player

Desc:

SNEAKING IS EXEMPT, EXPLICITLY. It very likely already was - crouching increments
crouch_one_cm and the sum below only reads walk and sprint - but "very likely" is
not good enough for the mechanic an entire piece of loot is built around. The
Quiet Hours grant Swift Sneak III precisely so you can reposition through his
silence window, and that promise should not rest on which counter vanilla happens
to tick while crouched.
The predicate reads the sneak flag off the player directly, so it is exact and it
cannot drift with a version change.
Sum walk and sprint, subtract the snapshot taken when the window opened, and
anything over twenty centimetres is a step. The slack is what stops his own recall
pull, a knockback or a slab from setting him off - being shoved is not disobedience.

lib_quiet_watch

phantoms_keep:boss/lib_quiet_watch

Is anybody moving?
Within:

function phantoms_keep:boss/librarian_tick, while the window is open

Desc:

Sum walk and sprint now, subtract the snapshot, and anything over twenty
centimetres is a step. The slack is what stops his own recall pull, a knockback or
a slab from setting him off - being shoved is not disobedience.

lib_recall

phantoms_keep:boss/lib_recall

RECALL - you may not take it out of the room
Within:

function phantoms_keep:boss/librarian_tick, as the boss, at him

Desc:

Everyone within twenty is dragged in toward him. He is slow - 0.28, deliberately
below a walking player - so without this he would simply be kited round the room
for as long as anyone had arrows. This is the answer to that, and it is the answer
a librarian would give.
IT FEEDS THE SHELVING. He pulls the room in, then files whoever ends up nearest,
which is why the two timers are 200 and 240 rather than something that keeps them
apart - they are meant to land close together.
The pull is a Motion write toward him rather than a teleport: it can be fought,
a shield or a block behind you still matters, and it does not yank anyone through
a wall the way a tp would.

lib_recall_pull

phantoms_keep:boss/lib_recall_pull

Drag one reader back to the desk
Within:

function phantoms_keep:boss/lib_recall, as the player being pulled

Desc:

`facing` the boss then a small forward Motion is the only way to build a vector
toward something without doing the arithmetic by hand - the same trick the Gong's
arms and his own fang line use. A little lift so the pull carries over a slab or a
plate rather than scuffing to a halt against one.

lib_shelves

phantoms_keep:boss/lib_shelves

Sixteen stacks of books, grown in the dark
Within:

function phantoms_keep:boss/ritual, at ritual tick 30, librarian only
alcove, which read as a bookcase rather than as the room a librarian would haunt.
Each wall carries four usable columns interleaved with the architecture -
shelf, pillar, shelf, copper, shelf, pillar, shelf - and the pillars and the copper
are the building, so they stay.
SEVEN COURSES, SET BY THE SHORTEST ALCOVE IN THE WORST ROTATION. These offsets are
world-relative, so ~-1 ~ ~-14 addresses whichever alcove ends up on the -Z side,
and which of the four that is depends on how the jigsaw turned the keep. The four
are NOT the same height - copper lanterns hang between 8 and 14 blocks up - so the
only safe height is the one that fits the shortest.
The offset set is closed under (x,z) -> (-z,x) and every position was checked
against the structure before this file was written. Both are asserted by
scratchpad/gen_shelves.py, which generates it - do not hand-edit.
north (-Z) wall

lib_shelves_clear

phantoms_keep:boss/lib_shelves_clear

The stacks come down with him
Within:

function phantoms_keep:boss/cleanup, as the arena marker, at it
alcove, which read as a bookcase rather than as the room a librarian would haunt.
Each wall carries four usable columns interleaved with the architecture -
shelf, pillar, shelf, copper, shelf, pillar, shelf - and the pillars and the copper
are the building, so they stay.
SEVEN COURSES, SET BY THE SHORTEST ALCOVE IN THE WORST ROTATION. These offsets are
world-relative, so ~-1 ~ ~-14 addresses whichever alcove ends up on the -Z side,
and which of the four that is depends on how the jigsaw turned the keep. The four
are NOT the same height - copper lanterns hang between 8 and 14 blocks up - so the
only safe height is the one that fits the shortest.
The offset set is closed under (x,z) -> (-z,x) and every position was checked
against the structure before this file was written. Both are asserted by
scratchpad/gen_shelves.py, which generates it - do not hand-edit.
north (-Z) wall

lib_shelving

phantoms_keep:boss/lib_shelving

SHELVING - he files you where you stand
Within:

function phantoms_keep:boss/librarian_tick

Desc:

Bookshelves erupt in a ring around one player, he tells them why, and a bolt comes
down on it.
It takes one player at a time, the nearest, so in a group it splits people up
rather than catching everybody at once - which would only be an area attack with
extra steps.
A marker carries the timing, not a schedule, because the cage has to be built at a
POSITION and `schedule` cannot carry one. Same reason the ghast, the ritual and the
Gong all use markers.

lib_shout

phantoms_keep:boss/lib_shout

What he says
Within:

function phantoms_keep:boss/librarian_tick, boss/summon_librarian

Desc:

Cyan and bold, so he is visibly not the Mason. Every line is about the count being
wrong, because that is the only thing he ever cared about.

lib_shout_reset

phantoms_keep:boss/lib_shout_reset

Within:

function phantoms_keep:boss/librarian_tick

lib_stars

phantoms_keep:boss/lib_stars

The warning shot - eight lines of stars where the blast will go
Within:

function phantoms_keep:boss/librarian_tick, at punish tick 30, at the boss

Desc:

`execute rotated <yaw> 0` with a literal bearing, then `positioned ^ ^ ^r`, walks
out along each of the eight arms with no marker and no trigonometry. Three
distances per arm is enough to read as a line pointing outward.
THE TELEGRAPH IS THE WHOLE MOVE. The blast lands on these exact bearings eighteen
ticks later, so a player who reads the stars can stand in a gap. Without it, the
punishment is just damage for having taken a step - with it, the step is a mistake
you are given one second to answer.
Faint on purpose: end_rod and a little blue dust over a single chime. A warning has
to be legible in under a second without drowning the room it is warning about.

lib_throw

phantoms_keep:boss/lib_throw

THE RETURNS - he throws the books back at you
Within:

function phantoms_keep:boss/librarian_tick

Desc:

REAL ITEM ENTITIES, NOT A PARTICLE. Vanilla has no thrown-book projectile, so the
choice was a stream of item particles or actual dropped books flown at the player.
Real ones win: they spin, they catch the light, they are unmistakably BOOKS from
across the room, and there is no per-version particle-options syntax to get wrong.
PickupDelay is maxed so nobody can hoover up his ammunition mid-fight, and Age is
set near the despawn threshold so any book that misses everything is gone in about
ten seconds without the pack having to track it.
Three at a time, thrown from head height, because one is a nuisance and five is a
shotgun. They home in lib_book_step rather than being aimed here - a fired arc
would miss constantly against a moving player, and a librarian throwing books that
curve after you is a better idea than one with good aim.
NEXT ONE AT A RANDOM TIME. Setting the clock to a random negative value means the
next throw lands somewhere between 10 and 25 seconds from now instead of on a beat
you can count. A boss whose every move is metronomic is a rotation to be memorised;
the books should feel like he simply got annoyed again.

lib_weight

phantoms_keep:boss/lib_weight

THE WEIGHT OF THE STACKS - he puts the whole archive on your shoulders
Within:

function phantoms_keep:boss/librarian_tick, as the librarian, at him

Desc:

HIS ANSWER TO BEING OUTRUN. Every other move he has is a projectile or a trap, so
a player who simply keeps moving beats all of them. This is the one that makes the
room small: slowness III for six seconds on everyone within sixteen, and mining
fatigue with it so the obvious counter of digging out of a cage does not work
either.
Slowness III rather than IV. Three still lets you walk - it makes the arena feel
long, which is the point. Four reads as being frozen and hands the fight to him.
NOT a hard counter to the cage: the durations are chosen so the weight wears off
a little before a cage cast at the same moment would, so being caught while slow
is survivable if you were already near the gap.
Announced BEFORE it lands, with a full second of book-dust falling first, so it is
a move you can see coming and back out of rather than a tax on standing still.

mark_fighters

phantoms_keep:boss/mark_fighters

Mark everyone in the fight
Within:

function phantoms_keep:boss/tick

Desc:

Run AT the boss, so `distance` is measured from it and not from world origin -
the same trap that made the boss bars show for everyone on the server.

mason_tick

phantoms_keep:boss/mason_tick

The Mason, one tick
Within:

function phantoms_keep:boss/boss_one

Desc:

Smash on a short cooldown, apprentices on a long one. Thresholds at two thirds
and one third of 200, matching how the other three stage.

mirage_master_tick

phantoms_keep:boss/mirage_master_tick

The Mirage Master, per tick
Within:

function phantoms_keep:boss/boss_one, as him, at him

Desc:

SIX CLOCKS AND ONE HEALTH TRIGGER. Recant is on HEALTH, not a clock, so it lands once
at the halfway mark rather than on a timer that might fire twice - the latch is what
keeps it once, since a health test alone would re-fire every tick he sits below it.
HIS COPIES ARE HIS ARMOUR. He takes resistance for as long as any double stands, which
is what turns the Gallery from a tax on your patience into the fight itself: swinging
at the real one through a crowd barely marks him, so you clear the room and then
commit. Counted every tick rather than latched at summon, because the answer has to
update the instant the last copy drops.
Bounded to 24 - the chamber radius - so one Mirage Master cannot count another's
copies (D63).

mm_blind

phantoms_keep:boss/mm_blind

BLIND - the vanilla spell, given a wall to hide behind
Within:

function phantoms_keep:boss/mirage_master_tick, as him, at him

Desc:

The illusioner casts blindness on its own; this adds the curtain, so the blindness
arrives as something you SAW coming rather than as a screen that simply goes dark.

mm_doubles

phantoms_keep:boss/mm_doubles

DOUBLES - three of him, and none of them are him
Within:

function phantoms_keep:boss/mirage_master_tick, as him, at him

Desc:

One health each, so a double dies to a single hit and the move costs you time rather
than health - the point is that you spend three swings finding out which one is real,
not that the copies are dangerous.
Capped at six, counted first, tagged as adds so cleanup culls them with him.

mm_gallery

phantoms_keep:boss/mm_gallery

THE GALLERY - he hangs the room with himself
Within:

function phantoms_keep:boss/mirage_master_tick, as him, at him

Desc:

FIVE COPIES, counted before any are summoned, on the same contract the Broodmother's
brood and the Warden's splinters use - uncapped, a long fight becomes a slideshow and
the frame rate decides it.
They still die to one hit. What changed is mirage_master_tick, which gives HIM
resistance for as long as any of them stands, so the copies are no longer a tax on
your patience - they are his armour, and clearing them is how the fight is won.

mm_misdirect

phantoms_keep:boss/mm_misdirect

MISDIRECTION - you are the one who moves
Within:

function phantoms_keep:boss/mirage_master_tick, as him, at him

Desc:

EVERY OTHER BOSS MOVES ITSELF. Swap trades him with a copy; the Void Weaver displaces;
the Arch-Evoker withdraws. This one leaves him exactly where he is and moves YOU - to
wherever one of his copies happens to be standing, which is the worst place to arrive.
Gated on a copy existing, so it cannot fire into an empty room and teleport everyone
onto themselves. `execute as ... run tp @s <entity>` rather than `tp @a[...] <entity>`:
the bare form is ambiguous with single-argument tp.

mm_recant

phantoms_keep:boss/mm_recant

RECANT - halfway down, he puts the candles out and makes you read the room again
Within:

function phantoms_keep:boss/mirage_master_tick, as him, at him

Desc:

THE ONE MOVE THAT REACHES BACK INTO HIS OWN RITE. Every candle in the hold goes dark
and the false cell is re-rolled, so the deduction has to be done a second time while he
is standing on you. It is the only boss move in the pack that re-opens its puzzle.
Latched, so it happens once rather than every tick he spends below half.

mm_seen

phantoms_keep:boss/mm_seen

He is somewhere again
Within:

function phantoms_keep:boss/mirage_master_tick, as him, at him

Desc:

Clearing the effect as well as restoring the plate, because the eight second duration
is deliberately longer than the hundred and forty tick clock - the move ends when the
fight says so, not when the potion timer happens to run out.

mm_swap

phantoms_keep:boss/mm_swap

SWAP - he trades places with one of his own copies
Within:

function phantoms_keep:boss/mirage_master_tick, as him, at him

Desc:

Same three-position trick the Void Weaver's Displace uses: a marker holds his spot so
the second teleport does not read a position he has already left.
Gated in the tick on a double actually existing, so he cannot swap with nothing and
teleport himself into a wall.

mm_unseen

phantoms_keep:boss/mm_unseen

THE UNSEEN - he stops being anywhere in particular
Within:

function phantoms_keep:boss/mirage_master_tick, as him, at him

Desc:

THE NAME PLATE COMES DOWN TOO. Invisibility alone does almost nothing to a mob whose
name is floating over it in white text - the plate renders through walls and through
the effect, so without dropping it this move would be decorative.
His end_rod trail keeps running in mirage_master_tick, so he is trackable by somebody
paying attention and invisible to somebody panicking. That is the whole fight in one
move.

ms_apprentices

phantoms_keep:boss/ms_apprentices

The Mason - apprentices
Within:

function phantoms_keep:boss/mason_tick

Desc:

Capped the same way the Gate-Captain's guards are, so a long fight does not become
a crowd. Stone axes, not maces - the hammer is his.

ms_bat_bite

phantoms_keep:boss/ms_bat_bite

A bat got you
Desc:

Two damage. Deliberately small - the bats are not a damage race, they are an
attention tax. One is a nuisance you ignore; eight of them while he is winding up
the Gong is a decision about where to look.
Typed mob_attack and credited to the bat, so armour and thorns behave the way a
player expects from something biting them.

ms_bat_expire

phantoms_keep:boss/ms_bat_expire

The bat has had its thirty seconds
Within:

function phantoms_keep:boss/ms_bat_tick, as the bat

ms_bat_tick

phantoms_keep:boss/ms_bat_tick

One of his bats, hunting
Within:

function phantoms_keep:boss/tick, as each phantoms_keep_ms_bat

Desc:

A VANILLA BAT CANNOT ATTACK ANYTHING. It has no attack goal and no attack damage
attribute, so no amount of NBT will make one bite - giving it attack_damage does
nothing because nothing ever calls for it. Both halves have to be supplied here:
the hunting, and the bite.
HUNTING is `facing entity` then a small forward tp. That overrides the bat's own
fluttering each tick, which is the point - left to its own AI a bat drifts off and
ignores everyone. 0.22 per tick is about 4.4 blocks a second: slower than a
sprinting player, so they can be outrun, but they never lose the scent and they
catch you the moment you stop to fight him.
BITING is on a per-bat cooldown, not per tick. Without it a bat sitting in a
player's hitbox would deal damage twenty times a second. 30 ticks between bites
makes one bat a nuisance and six of them a reason to stop what you are doing.
They expire. 600 ticks is thirty seconds, long enough to matter and short enough
that a drawn-out fight does not end up with forty of them in the room.

ms_peal

phantoms_keep:boss/ms_peal

THE PEAL - he rings every bell at once and the sound comes for you
Within:

function phantoms_keep:boss/mason_tick
THIRTY-TWO ARMS, NOT SIXTEEN. At 11.25 degrees apart the fronts are close enough
that neighbouring arms read as one continuous wall by the time it is a few blocks
out, instead of sixteen separate darts. A sound wave has no gaps in it.
bell/peal does the audio half - all five notes on the same tick, the chord the
puzzle never lets you hear, rung wrong and all together by the man who would not
count them.
The eruption is gold over black: dust in bell-bronze for the ring itself, soul and
large_smoke underneath it for the dark it comes out of. Both leave him at once so
the wave looks thrown rather than grown.

ms_shout

phantoms_keep:boss/ms_shout

The Mason - he has something to say about it
Within:

function phantoms_keep:boss/mason_tick, boss/summon_mason

Desc:

Eight lines, rolled. Every one of them is about the bells or the count, because
those are the two things that woke him: someone rang the towers he raised, and
the towers are the thing he refused to write a number for.
Shouted to everyone within 40 rather than sent to the fighters, so a player who
hears it from a floor away knows something is loose in the keep.

ms_shout_reset

phantoms_keep:boss/ms_shout_reset

Reset the shout timer and shout
Within:

function phantoms_keep:boss/mason_tick

Desc:

Split from ms_shout so the roll function can also be called straight from the
summon without resetting a counter that does not exist yet.

ms_smash

phantoms_keep:boss/ms_smash

The Mason - the hammer comes down
Within:

function phantoms_keep:boss/mason_tick

Desc:

He swings the mace into the floor. The boom does NO damage - it is a shove, not a
hit. Getting flung across the room while he walks toward you is the threat; his
melee is where the damage lives.
Knockback comes from breeze wind charges rather than a damage call, because a
zero-damage `damage` applies no impulse at all and anything above zero is damage
by definition. Wind charges deal none and shove hard, which is exactly the tool.
Six of them in a ring, spawned low with downward motion so they burst on the floor
the instant they exist - the shockwave leaves from his feet outward, and standing
further out means catching less of it.
Four damage, deliberately light. The Gate-Captain's slam does seven on a cooldown
nearly twice as long, and this one already flings you and takes your legs for five
seconds - if it hit as hard as it shoves, standing anywhere near him would just be
death rather than a mistake you can recover from.
The daze is the real cost. Five seconds of slowness and weakness applied in a
radius of six, one wider than the charges reach, so being shoved and being dazed
are the same event even at the edge - there is no ring where you get flung but
walk it off. Weakness is what makes it hurt: you are not just out of position,
you cannot punish him for closing while you are down.

ms_swarm

phantoms_keep:boss/ms_swarm

THE BELFRY EMPTIES - the rare one
Within:

function phantoms_keep:boss/ms_shout, on a 1-in-6 roll

Desc:

Most shouts give you two bats. One in six gives you six, off the ceiling, all
at once. Rare enough that it is an event rather than a rhythm, and because it
rides the shout timer there is a warning: he is always yelling before it happens.
Six, halved from twelve after testing. Each bites 2 every 30 ticks, so six is 12 damage
across a bite cycle if every one connects - present without crowding the screen
out, and they are 6 HP each so a single sweep clears the air.

ms_wave_hit

phantoms_keep:boss/ms_wave_hit

A Gong arm caught a player
Within:

function phantoms_keep:boss/ms_wave_step, as the player, at the player

Desc:

Damage is sonic_boom typed, so armour does not soak it - the same reasoning
vanilla uses for the warden. It is the price of being caught in the open when the
bells answer, and armour has nothing to say about sound.
Deafness rather than a hard stun: 2 seconds of darkness and nausea. It reads as
your ears ringing, it is genuinely disorienting in a pillared room, and unlike
slowness it does not stop you running - it just makes running the wrong way easy.
The smash already owns slow-and-weak; this needed its own texture or the two moves
would feel like one move at two ranges.
Tagged immediately so the remaining fifteen arms pass through harmlessly.

ms_wave_step

phantoms_keep:boss/ms_wave_step

One step of the Gong's wavefront
Within:

function phantoms_keep:boss/tick, as each phantoms_keep_ms_wave marker

Desc:

A WALL, NOT A LINE. Each arm draws a column two blocks tall rather than a dot on
the floor, so thirty-two of them together are a curtain of sound sweeping outward.
Gold over black: bronze dust for the ring, dark dust and smoke behind it.
IT STARTS THREE BLOCKS OUT. Drawn from step 4, by which point the arm has cleared
him. Born at his feet with falling drips, the opening frames looked - accurately -
like the boss was voiding lava. dripping_lava is gone entirely; everything here
hangs or rises.
IT STOPS AT WALLS, so the Gong cannot reach through the arena shell and hit
somebody standing in the corridor outside.

music_archivist

phantoms_keep:boss/music_archivist

Archivist theme
Within:

function phantoms_keep:boss/fight_music_start

music_arch_evoker

phantoms_keep:boss/music_arch_evoker

His track
Within:

function phantoms_keep:boss/fight_music_start, as a player in the fight

Desc:

music.arch_evoker was already finished and sitting unplayed in the resource pack, along with the
three other undercroft tracks. Nothing new had to be made.

music_broodmother

phantoms_keep:boss/music_broodmother

Her track
Within:

function phantoms_keep:boss/fight_music_start, as a player in the fight

Desc:

music.broodmother was ALREADY in the resource pack, along with mirage_master,
void_weaver and arch_evoker for bosses that do not exist yet. The first cut of
this file borrowed music.vault from the librarian on the assumption that all six
tracks were spoken for - they were not, and there are three more waiting.

music_captain

phantoms_keep:boss/music_captain

Gate-Captain theme
Within:

function phantoms_keep:boss/fight_music_start

music_librarian

phantoms_keep:boss/music_librarian

Within:

function phantoms_keep:boss/fight_music_start

Desc:

music.vault was written and never used - a keep with four bosses had five unused
tracks. The under-stacks is exactly where it belongs.

music_mason

phantoms_keep:boss/music_mason

The Mason's theme
Within:

function phantoms_keep:boss/fight_music_start

Desc:

music.rampart was already in the resource pack and unused. It is the walls' theme,
and he is the man who built them.

music_mirage_master

phantoms_keep:boss/music_mirage_master

His track
Within:

function phantoms_keep:boss/fight_music_start, as a player in the fight

Desc:

music.mirage_master was already finished and sitting unplayed in the resource pack, along with the
three other undercroft tracks. Nothing new had to be made.

music_pale_warden

phantoms_keep:boss/music_pale_warden

His track
Within:

function phantoms_keep:boss/fight_music_start, as a player in the fight

Desc:

music.hall was already finished and sitting unplayed in the resource pack, along with the
three other undercroft tracks. Nothing new had to be made.

music_phantom

phantoms_keep:boss/music_phantom

Hollow Phantom theme
Within:

function phantoms_keep:boss/fight_music_start

music_void_weaver

phantoms_keep:boss/music_void_weaver

His track
Within:

function phantoms_keep:boss/fight_music_start, as a player in the fight

Desc:

music.void_weaver was already finished and sitting unplayed in the resource pack, along with the
three other undercroft tracks. Nothing new had to be made.

pale_warden_tick

phantoms_keep:boss/pale_warden_tick

The Pale Warden, per tick
Within:

function phantoms_keep:boss/boss_one, as him, at him

Desc:

HIS INVULNERABILITY IS A PROPERTY OF THE ROOM, not of him. Where there are roots he
cannot be touched and the hearts are the fight; where there are none - a relic summon
at any other altar - he takes damage like anything else. Read every tick rather than
latched at summon, because a latched flag would leave a relic-called Warden
permanently unkillable the moment anyone called him outside the heart chamber.
The two lines are an if/unless pair on an ENTITY test, not a score, so neither can
feed the other (D62 does not apply).

pw_fall

phantoms_keep:boss/pw_fall

THE FALL - he brings a limb down where he stands
Within:

function phantoms_keep:boss/pale_warden_tick, as him, at him

Desc:

THE ONLY THING HE DOES THAT LANDS WHILE HE IS FROZEN. A Creaking cannot move while a
player is looking at it, so his melee almost never connects - the whole fight was
hazard-avoidance with no damage in it. This fires from a command, which the freeze
does not gate, so staring at him keeps him still but no longer keeps you safe.
`by @s` rather than a bare damage type: it credits him as the attacker, so the hit
carries knockback away from him and reads as his rather than as the room's.
Radius 5 against a 2.2-scale mob is roughly his own reach. The answer is to break
line of sight and be somewhere else, which is the same answer the heart hunt already
wants - it makes the two halves of the fight pull in the same direction.

pw_grasp

phantoms_keep:boss/pw_grasp

ROOT-GRASP - the floor takes hold of whoever is standing on it
Within:

function phantoms_keep:boss/pale_warden_tick, as him, at him

Desc:

His answer to being kited while you hunt his heart. Slowness IV for three seconds is
nearly a stop, but it lands where you ARE rather than where he is, and it is
telegraphed by a second of rising dust, so it punishes standing still in the open
rather than punishing movement.

pw_splinter

phantoms_keep:boss/pw_splinter

SPLINTER - lesser creakings out of the dead roots
Within:

function phantoms_keep:boss/pale_warden_tick, as him, at him

Desc:

CAPPED AT FOUR, counted before anything is summoned - the same contract the
Broodmother's brood uses. Uncapped, a long hunt turns into a creaking tide and the
frame rate decides the fight.
They are ordinary creakings with no heart behind them, so unlike him they can simply
be killed. That is the point: they are the tax on taking too long.

pw_turning

phantoms_keep:boss/pw_turning

THE TURNING - the chamber goes out
Within:

function phantoms_keep:boss/pale_warden_tick, as him, at him

Desc:

Six seconds of dark in a room whose whole fight is about finding a particular block.
It does not blind - blindness would make it unplayable rather than tense - it douses
the copper bulbs, so a player who lit the mandala on the way in keeps some of it.
Bounded to 24, the chamber radius, so a Turning in one arena cannot reach another.

razorback_tick

phantoms_keep:boss/razorback_tick

The Razorback, one tick
Within:

function phantoms_keep:boss/boss_one

Desc:

Three states, and the state is what makes it readable: PAWING (a tell you can act on),
CHARGING (get out of the lane), STUNNED (hit it now).
ORDER IS LOAD-BEARING HERE (D62). Two moves write the counter this function then reads,
so both are invoked with `return run`: rb_gore, which ends a connecting charge, and rb_paw,
which starts a new one. Without that, a gore stunned the boar it had just hit, and a paw
lost its first tick to the increment below it. The stage checks sit ABOVE the returns so
they cannot be skipped by either. rb_overrun returns for the same reason.
THE CHARGE IS COUNTER-DRIVEN, NOT AI-DRIVEN. Hoglin AI will not run a lane on command, so
it is Speed IV for a fixed window plus a proximity test. Counter-driven also guarantees it
ENDS: a charge that waits to reach its target never ends when the target leaves.

rb_bellow

phantoms_keep:boss/rb_bellow

The Razorback - the bellow
Within:

function phantoms_keep:boss/razorback_tick

Desc:

It calls the drift - the rest of the herd, half feral, that lives in the ruins with it.
Three of them, immune to zombification like their sire, and they despawn with the fight
through the usual cleanup because they carry the boss-add tag.
The bellow itself does no damage. It applies nausea, which in a village of identical lanes
is worth more than a hit: the fight is about knowing which way to run, and this is the one
move that takes that away from you.

rb_charge

phantoms_keep:boss/rb_charge

The Razorback - it runs
Within:

function phantoms_keep:boss/razorback_tick, on tick 41 of the wind-up

Desc:

Speed IV for the length of the charge. The slowness from the paw is cleared here rather
than left to expire, because two effects fighting each other is how you get a boss that
stutters instead of charging.

rb_gore

phantoms_keep:boss/rb_gore

The Razorback - the tusks find you
Within:

function phantoms_keep:boss/razorback_tick, while charging, someone within 2.6

Desc:

THE PUNISHMENT, and it is heavy on purpose - twelve, against the Guard's six. The charge
is telegraphed for two seconds and takes one lane; being hit by it is a decision.
Clearing the counter here is also what stops one charge hitting the same player fifty
times: without it a run through a group is a wood chipper, not a boss move.

rb_overrun

phantoms_keep:boss/rb_overrun

The Razorback - it cannot stop
Within:

function phantoms_keep:boss/razorback_tick, when the charge window closes UNHIT

Desc:

Reached only when the counter ran the full window, because rb_gore zeroes it on a hit and
returns. So arriving here means one thing and needs no second flag: it missed.
The stun is the whole reward for having moved, and it is generous - six seconds with the
armour gone. This is the boar's mirror of the Guard's vent: both bosses hand you their own
opening, from opposite directions.

rb_paw

phantoms_keep:boss/rb_paw

The Razorback - it paws the ground
Within:

function phantoms_keep:boss/razorback_tick

Desc:

Two full seconds of warning before it moves. That is generous and it is meant to be: the
charge hits hard enough that an unreadable version would just be a damage tax, and the
whole fight is built on the player CHOOSING to leave the lane.
It roots itself for the wind-up - slowness 250 rather than a mount or a teleport, so it
visibly gathers rather than freezing - which also stops it drifting off the line it is
about to run.

rb_recover

phantoms_keep:boss/rb_recover

The Razorback - it gets its feet back
Within:

function phantoms_keep:boss/razorback_tick

Desc:

Armour back, and the next charge comes sooner in the later stages. Same principle as the
Guard's vent: the fight speeds up, the window never shrinks.

regalia_arch

phantoms_keep:boss/regalia_arch

The Regalia: Marginalia
Within:

function phantoms_keep:boss/drop_archivist, as the player who landed the kill

Desc:

The archivist wrote in the margins.
ALWAYS DROPS, and it is the only thing in this pack besides the relic that does. The rolled
prizes are variety; this is the reason to fight the boss at all, and a signature piece
behind a one-in-ten roll is a signature piece most players never see.
RARITY IS EXPLICIT. Vanilla infers rarity from the material, so a named diamond sword is
"common" in the tooltip unless told otherwise - which makes twelve special items look
exactly like the diamond gear a player already has.
THE TALLY COUNTS DISTINCT BOSSES. The flag is checked before it is set, so the twelfth
kill of one boss adds nothing and the capstone cannot be farmed.

regalia_brod

phantoms_keep:boss/regalia_brod

The Regalia: Eight-Legged
Within:

function phantoms_keep:boss/drop_broodmother, as the player who landed the kill

Desc:

She lived in the cracks, so her pick finds them.
ALWAYS DROPS, and it is the only thing in this pack besides the relic that does. The rolled
prizes are variety; this is the reason to fight the boss at all, and a signature piece
behind a one-in-ten roll is a signature piece most players never see.
RARITY IS EXPLICIT. Vanilla infers rarity from the material, so a named diamond sword is
"common" in the tooltip unless told otherwise - which makes twelve special items look
exactly like the diamond gear a player already has.
THE TALLY COUNTS DISTINCT BOSSES. The flag is checked before it is set, so the twelfth
kill of one boss adds nothing and the capstone cannot be farmed.

regalia_capstone

phantoms_keep:boss/regalia_capstone

The Court Adjourned - all twelve
Within:

function phantoms_keep:boss/regalia_check, as the player

Desc:

The reward for beating every boss the keep has. Elytra, because after twelve of them the
interesting prize is not more damage - it is being able to leave.
EPIC rarity, the only item in the pack that carries it, so the tooltip itself says this is
the end of something.
Latched, and announced to everyone: finishing the keep should be a thing the server sees.

regalia_capt

phantoms_keep:boss/regalia_capt

The Regalia: The Captain's Cuirass
Within:

function phantoms_keep:boss/drop_gate_captain, as the player who landed the kill

Desc:

He stood in the doorway and did not move.
ALWAYS DROPS, and it is the only thing in this pack besides the relic that does. The rolled
prizes are variety; this is the reason to fight the boss at all, and a signature piece
behind a one-in-ten roll is a signature piece most players never see.
RARITY IS EXPLICIT. Vanilla infers rarity from the material, so a named diamond sword is
"common" in the tooltip unless told otherwise - which makes twelve special items look
exactly like the diamond gear a player already has.
THE TALLY COUNTS DISTINCT BOSSES. The flag is checked before it is set, so the twelfth
kill of one boss adds nothing and the capstone cannot be farmed.

regalia_check

phantoms_keep:boss/regalia_check

Has this player beaten all twelve?
Within:

every phantoms_keep:boss/regalia_* function, as the player

Desc:

Twelve distinct bosses, then the capstone, once.
LATCHED ON THE PLAYER, not on a keep marker - this is the only state in the pack that is
genuinely about the PLAYER rather than about a keep, because the Regalia is collected
across every keep they ever visit. A per-keep latch would demand twelve bosses from one

regalia_evok

phantoms_keep:boss/regalia_evok

The Regalia: Recusal
Within:

function phantoms_keep:boss/drop_arch_evoker, as the player who landed the kill

Desc:

He recused himself, and fired anyway.
ALWAYS DROPS, and it is the only thing in this pack besides the relic that does. The rolled
prizes are variety; this is the reason to fight the boss at all, and a signature piece
behind a one-in-ten roll is a signature piece most players never see.
RARITY IS EXPLICIT. Vanilla infers rarity from the material, so a named diamond sword is
"common" in the tooltip unless told otherwise - which makes twelve special items look
exactly like the diamond gear a player already has.
THE TALLY COUNTS DISTINCT BOSSES. The flag is checked before it is set, so the twelfth
kill of one boss adds nothing and the capstone cannot be farmed.

regalia_guar

phantoms_keep:boss/regalia_guar

The Regalia: The List
Within:

function phantoms_keep:boss/drop_household_guard, as the player who landed the kill

Desc:

The guard IS a shield, and the list is what it held.
ALWAYS DROPS, and it is the only thing in this pack besides the relic that does. The rolled
prizes are variety; this is the reason to fight the boss at all, and a signature piece
behind a one-in-ten roll is a signature piece most players never see.
RARITY IS EXPLICIT. Vanilla infers rarity from the material, so a named diamond sword is
"common" in the tooltip unless told otherwise - which makes twelve special items look
exactly like the diamond gear a player already has.
THE TALLY COUNTS DISTINCT BOSSES. The flag is checked before it is set, so the twelfth
kill of one boss adds nothing and the capstone cannot be farmed.

regalia_libr

phantoms_keep:boss/regalia_libr

The Regalia: The Last Word
Within:

function phantoms_keep:boss/drop_librarian, as the player who landed the kill

Desc:

The librarian always had the last word.
ALWAYS DROPS, and it is the only thing in this pack besides the relic that does. The rolled
prizes are variety; this is the reason to fight the boss at all, and a signature piece
behind a one-in-ten roll is a signature piece most players never see.
RARITY IS EXPLICIT. Vanilla infers rarity from the material, so a named diamond sword is
"common" in the tooltip unless told otherwise - which makes twelve special items look
exactly like the diamond gear a player already has.
THE TALLY COUNTS DISTINCT BOSSES. The flag is checked before it is set, so the twelfth
kill of one boss adds nothing and the capstone cannot be farmed.

regalia_masn

phantoms_keep:boss/regalia_masn

The Regalia: Set True
Within:

function phantoms_keep:boss/drop_mason, as the player who landed the kill

Desc:

He set every stone true, so his boots never slip.
ALWAYS DROPS, and it is the only thing in this pack besides the relic that does. The rolled
prizes are variety; this is the reason to fight the boss at all, and a signature piece
behind a one-in-ten roll is a signature piece most players never see.
RARITY IS EXPLICIT. Vanilla infers rarity from the material, so a named diamond sword is
"common" in the tooltip unless told otherwise - which makes twelve special items look
exactly like the diamond gear a player already has.
THE TALLY COUNTS DISTINCT BOSSES. The flag is checked before it is set, so the twelfth
kill of one boss adds nothing and the capstone cannot be farmed.

regalia_mira

phantoms_keep:boss/regalia_mira

The Regalia: False Ground
Within:

function phantoms_keep:boss/drop_mirage_master, as the player who landed the kill

Desc:

His whole trick was ground that was not there.
ALWAYS DROPS, and it is the only thing in this pack besides the relic that does. The rolled
prizes are variety; this is the reason to fight the boss at all, and a signature piece
behind a one-in-ten roll is a signature piece most players never see.
RARITY IS EXPLICIT. Vanilla infers rarity from the material, so a named diamond sword is
"common" in the tooltip unless told otherwise - which makes twelve special items look
exactly like the diamond gear a player already has.
THE TALLY COUNTS DISTINCT BOSSES. The flag is checked before it is set, so the twelfth
kill of one boss adds nothing and the capstone cannot be farmed.

regalia_phan

phantoms_keep:boss/regalia_phan

The Regalia: The Hollow Crown
Within:

function phantoms_keep:boss/drop_hollow_phantom, as the player who landed the kill

Desc:

The phantom is the keep's memory of a wearer.
ALWAYS DROPS, and it is the only thing in this pack besides the relic that does. The rolled
prizes are variety; this is the reason to fight the boss at all, and a signature piece
behind a one-in-ten roll is a signature piece most players never see.
RARITY IS EXPLICIT. Vanilla infers rarity from the material, so a named diamond sword is
"common" in the tooltip unless told otherwise - which makes twelve special items look
exactly like the diamond gear a player already has.
THE TALLY COUNTS DISTINCT BOSSES. The flag is checked before it is set, so the twelfth
kill of one boss adds nothing and the capstone cannot be farmed.

regalia_razr

phantoms_keep:boss/regalia_razr

The Regalia: Tusk-Driver
Within:

function phantoms_keep:boss/drop_razorback, as the player who landed the kill

Desc:

The charge, in your hands.
ALWAYS DROPS, and it is the only thing in this pack besides the relic that does. The rolled
prizes are variety; this is the reason to fight the boss at all, and a signature piece
behind a one-in-ten roll is a signature piece most players never see.
RARITY IS EXPLICIT. Vanilla infers rarity from the material, so a named diamond sword is
"common" in the tooltip unless told otherwise - which makes twelve special items look
exactly like the diamond gear a player already has.
THE TALLY COUNTS DISTINCT BOSSES. The flag is checked before it is set, so the twelfth
kill of one boss adds nothing and the capstone cannot be farmed.

regalia_void

phantoms_keep:boss/regalia_void

The Regalia: The Weaver's Draw
Within:

function phantoms_keep:boss/drop_void_weaver, as the player who landed the kill

Desc:

She spun a line with no end, which is what Infinity is.
ALWAYS DROPS, and it is the only thing in this pack besides the relic that does. The rolled
prizes are variety; this is the reason to fight the boss at all, and a signature piece
behind a one-in-ten roll is a signature piece most players never see.
RARITY IS EXPLICIT. Vanilla infers rarity from the material, so a named diamond sword is
"common" in the tooltip unless told otherwise - which makes twelve special items look
exactly like the diamond gear a player already has.
THE TALLY COUNTS DISTINCT BOSSES. The flag is checked before it is set, so the twelfth
kill of one boss adds nothing and the capstone cannot be farmed.

regalia_warp

phantoms_keep:boss/regalia_warp

The Regalia: Resin-Splitter
Within:

function phantoms_keep:boss/drop_pale_warden, as the player who landed the kill

Desc:

The warden is the pale wood, so its axe is what opens it.
ALWAYS DROPS, and it is the only thing in this pack besides the relic that does. The rolled
prizes are variety; this is the reason to fight the boss at all, and a signature piece
behind a one-in-ten roll is a signature piece most players never see.
RARITY IS EXPLICIT. Vanilla infers rarity from the material, so a named diamond sword is
"common" in the tooltip unless told otherwise - which makes twelve special items look
exactly like the diamond gear a player already has.
THE TALLY COUNTS DISTINCT BOSSES. The flag is checked before it is set, so the twelfth
kill of one boss adds nothing and the capstone cannot be farmed.

ritual

phantoms_keep:boss/ritual

The summoning ritual, one tick
Within:

function phantoms_keep:boss/tick

Desc:

RUNS AS THE RITUAL MARKER, at the altar. Four seconds of build-up so the summon
reads as something the altar DID rather than a mob appearing out of nowhere.
Escalates: a slow soul spiral, then reverse-portal suck-in, then the crack.

sign_book

phantoms_keep:boss/sign_book

Learn the name of whoever is standing here
Within:

the boss drop functions, as the player who landed the kill

Desc:

THE ONLY WAY TO GET A PLAYER'S NAME. It is in their GameProfile, never in saved NBT,
so no data path on the entity reaches it. A head stamped by fill_player_head carries
the profile; spawn one, read the name out of it, kill it. All inside a single tick, so
nobody ever sees the head.
The kill filters on player_head rather than taking the nearest item, because a boss
has just died and the floor is covered in drops.

sonic

phantoms_keep:boss/sonic

The Hollow Phantom's sonic scream
Within:

function phantoms_keep:boss/hollow_phantom_tick

Desc:

Warden-flavoured cone attack, deliberately weaker than the real thing.

stage2

phantoms_keep:boss/stage2

Any boss - second stage
Within:

function phantoms_keep:boss/hollow_phantom_tick, phantoms_keep:boss/gate_captain_tick, phantoms_keep:boss/archivist_tick

Desc:

Crossed two-thirds. Speed and a shorter fuse on everything - the cooldown
counters are advanced rather than the thresholds lowered, which speeds up the
NEXT ability without needing a second copy of every rule.

stage3

phantoms_keep:boss/stage3

Any boss - final stage
Within:

function phantoms_keep:boss/hollow_phantom_tick, phantoms_keep:boss/gate_captain_tick, phantoms_keep:boss/archivist_tick

Desc:

Below a third. Resistance and strength, so the last of the fight is the hardest
part rather than the easiest - a boss that only gets weaker has no third act.

summon_archivist

phantoms_keep:boss/summon_archivist

Summon The Archivist
Within:

function phantoms_keep:boss/call_archivist

Desc:

Junia Thale, still taking the record. An evoker - fangs and vexes suit a keeper of
the Register far better than a melee brawler.

summon_arch_evoker

phantoms_keep:boss/summon_arch_evoker

The Arch-Evoker
Within:

function phantoms_keep:boss/ritual, at ritual tick 80, arch_evoker only

summon_broodmother

phantoms_keep:boss/summon_broodmother

She comes up out of the dark, and she is not a spider any more
Within:

function phantoms_keep:boss/ritual, at ritual tick 80, broodmother only

Desc:

SCALE 2.4, which on a spider's already 1.4-block body is a little over three and a
half blocks across. That is the point - she cannot be strafed in a corridor and she
fills the arena's middle. Knockback resistance is high to match: a boss this size
being punted about by a sword would read as a prop.
NOT a cave spider. A cave spider carries poison in its bite for free, but it is
tiny, and 'a good bit bigger, 2x at least' rules it out - the model is what sells
her. She gets her venom from boss/bm_venom instead, which is more controllable
anyway: a burst on a timer that can be seen coming, rather than chip damage on
every hit.
ATTACK_KNOCKBACK 2.5 - she throws you. A vanilla spider barely nudges, which on a
boss this size reads wrong; the attribute is the right lever because vanilla then
handles direction, resistance and the knockback enchantment for free, where a
scripted velocity push would fight all three.
It is also the counter to her own web: being thrown out of a cluster you were
stuck in is a small mercy, and being thrown INTO one is the trap.
fall_damage_multiplier 0 for the same reason the Mason has it - her own web and
brood shove her around, and a boss killing herself on the arena steps is a bug.

summon_gate_captain

phantoms_keep:boss/summon_gate_captain

Summon The Gate-Captain
Within:

function phantoms_keep:boss/call_gate_captain

Desc:

Serla Voss, who wrote Orders for the Outer Watch and never stood down. A wither
skeleton captain - armoured, hard-hitting, no ranged trickery.

summon_hollow_phantom

phantoms_keep:boss/summon_hollow_phantom

Summon The Hollow Phantom
Within:

function phantoms_keep:boss/call_hollow_phantom
some special abilities", "I like the sonic scream, maybe it doesn't hit as hard as
the wardens though", "it can also call in some buddies (smaller ones)".
300 hp against a Warden's 500, and its sonic attack does 6 against the Warden's 10 - it
is an upper-tier dungeon boss, not a Warden reskin. scale 3.0 is the "bigger phantom";
a custom MODEL would need a resource pack and is not part of this.

summon_household_guard

phantoms_keep:boss/summon_household_guard

Summon The Household Guard
Within:

function phantoms_keep:boss/call_household_guard

Desc:

It was made to keep the ward safe and it is still doing that. It does not recognise you.
It was made before you, and given a list.
AN ANVIL, ON PURPOSE. armor 12 and knockback_resistance 1 mean you cannot shove it, cannot
kite it, and cannot meaningfully chip it - so a player who simply holds left-click loses.
The fight is the VENT: every sixteen seconds its plates open and the armour goes to zero
for eight. Everything else it does exists to stop you camping that window comfortably.
SLOW, at 0.27 against a golem's stock 0.25 and the Mason's 0.46. It must never run you
down - being able to walk away is what makes its reach worth respecting, and it is why
the ranged rivet exists at all.
fall_damage_multiplier 0 and explosion_knockback_resistance 1 for the same reason the
Mason has them: its own stamp summons wind charges, and a boss launched by its own move
reads as broken rather than as heavy.

summon_librarian

phantoms_keep:boss/summon_librarian

Summon The Under-Librarian
Within:

function phantoms_keep:boss/ritual

Desc:

Wessel Crane, Under-Librarian. Ranked beneath Junia Thale in the register and still
is, which is the whole of his grievance. She keeps the record; he only ever kept the
books, and the books are what came back.
A ZOMBIE VILLAGER, per the design note, not an evoker - the Archivist already holds
that slot and two evokers in one keep would read as one boss with two skins. He gets
evoker BEHAVIOUR through the datapack instead: fangs along the ground, and vexes
that are really his loose pages. The body is a librarian who died at his desk, which
is the point of him.
profession librarian and a locked trade level so he keeps the apron and the book
texture rather than rolling a random villager look on spawn.
THE STAFF IS A DIAMOND SPEAR - a real 26.2 item, one of a full spear family. He
carries it as a rule rather than a weapon, which is the joke: a rule is a straight
edge and a regulation at once, and he enforced both. lib_bolt is what it does.
drop_chances 0 on purpose. It drops through drop_librarian on a roll, not by
falling out of his hands - otherwise the rarest item in the encounter would be a
coin flip the pack does not control.
160 HP - below the Mason's 200 because he has ranged pressure and does not need to
survive being stood next to. Slow: 0.28 against a zombie's 0.23. He should be
something you back away from, not something that runs you down.

summon_mason

phantoms_keep:boss/summon_mason

Summon The Mason
Within:

function phantoms_keep:boss/ritual

Desc:

Hale Brann, Master Mason, who raised both rings, four gates, and the towers -
"though I will not set down how many towers". The bells hang in the towers he
built and would not count, so ringing them is what calls him. A vindicator with
a mace: no ranged trick, just a hammer and the shortest distance to you.
Knockback resistance is high but not total. He should be immovable, not a wall -
a boss you cannot budge at all in a room this size stops being a fight.
FAST. 0.46 against a vindicator's stock 0.35, so he runs down a sprinting player
rather than trailing them. Deliberately not higher, because stage two hands him
Speed I and stage three Speed II on top - 0.46 becomes about 0.64 by the last
third, and anything faster at full base would be unplayable by then rather than
frightening.
Step height 1.1 so stairs, slabs and the shrine plinth do not stop him. A fast
boss that snags on a half block reads as broken, not beatable. Follow range 48
keeps him coming across the main room instead of losing interest at 16.
- HE IS IMMUNE TO HIS OWN GROUND SLAM. ms_smash rings him with six
breeze_wind_charges, and an explosion does not care whose it is: they were
launching him, so he took the fall damage on landing, and the launch is also what
pitched his apprentices around hard enough to kill them. explosion_knockback_
resistance 1 stops the blast moving him at all, and fall_damage_multiplier 0
covers any other drop - off the plinth, off the stairs. The apprentices get both
attributes too, in ms_apprentices, for the same reason. Note this is separate from
knockback_resistance, which is 0.8 and governs being hit by a PLAYER: he should
still give ground to a solid axe blow.
A mace in the main hand and an axe in the off hand: the hammer he built with and
the tool he finished with. No helmet - the stone block was reading as a bug rather
than as stonemason's kit, so it is gone.

summon_mirage_master

phantoms_keep:boss/summon_mirage_master

The Mirage Master
Within:

function phantoms_keep:boss/ritual, at ritual tick 80, mirage_master only

summon_pale_warden

phantoms_keep:boss/summon_pale_warden

The Pale Warden
Within:

function phantoms_keep:boss/ritual, at ritual tick 80, pale_warden only#
A CREAKING SUMMONED BY COMMAND IS KILLABLE. The invulnerable-while-watched behaviour
belongs to creakings a creaking_heart spawned and tethered; one summoned with no
heart behind it takes damage normally. That is deliberate here: the relic path gives
the ordinary fight, and rite/heart gives the real one, where a live heart in the
roots makes him untouchable until you find it. Two difficulties from one mob.
max_health is 1 and Health 1f because the heart-bound form ignores both - the bar is
driven off the heart, not off him. The relic form overrides them on summon below.

summon_razorback

phantoms_keep:boss/summon_razorback

Summon The Razorback
Within:

function phantoms_keep:boss/call_razorback

Desc:

The keep kept pigs. This one got out, got old, and learned the streets. It has been eating
whatever falls from the walls ever since, and it knows the lanes better than you do.
IMMUNE TO ZOMBIFICATION, AND THIS IS NOT COSMETIC. A hoglin in the overworld converts to
a zoglin after about fifteen seconds. Without this flag the boss transforms mid-fight into
a different entity, losing its tags, its name, its bar and its loot - the fight simply
stops existing. Anything hoglin-based in an overworld pack needs it.
FAST AND SOFT, the exact inverse of the Guard: 0.36 against the Guard's 0.27, armour 5
against 12. You cannot outrun it, so you have to make it MISS - which is what the charge
and the overrun are for.

summon_void_weaver

phantoms_keep:boss/summon_void_weaver

The Void Weaver
Within:

function phantoms_keep:boss/ritual, at ritual tick 80, void_weaver only

tick

phantoms_keep:boss/tick

Boss behaviour, one tick
Within:

tag/function minecraft:tick

Desc:

Drives the bosses' abilities. Scoped by tag, so it costs a single entity selector
when no boss is alive rather than scanning players or chunks.
ONE FORK PER BOSS, NOT FIVE. Both wikis name forking as the single biggest cost -
every `execute as` branches into one execution per matched entity. This walked the
entity list five separate times per tick to dispatch work that can be decided once
inside a single branch. minecraft.wiki: "If running repeated similar selectors,
combine them and branch to separate functions using @s targeting instead."

void_weaver_tick

phantoms_keep:boss/void_weaver_tick

The Void Weaver, per tick
Within:

function phantoms_keep:boss/boss_one, as him, at him

Desc:

Tells read before the moves that clear their clocks (D62).

vw_displace

phantoms_keep:boss/vw_displace

DISPLACE - he changes places with one of you
Within:

function phantoms_keep:boss/void_weaver_tick, as him, at him

Desc:

A true swap, which needs a third position held for a moment - a marker takes his spot,
he goes to the player, the player goes to the marker, the marker dies. Without the
marker the second teleport would read his ALREADY MOVED position and both would end up
in the same place.

vw_gap

phantoms_keep:boss/vw_gap

THE GAP - what comes out of the slot the record never had
Within:

function phantoms_keep:boss/void_weaver_tick, as him, at him

Desc:

Capped at six, counted first. Endermites rather than more endermen: they are small,
they are fast, and they do not teleport, so they punish standing still without turning
the fight into four bosses at once.

vw_gather

phantoms_keep:boss/vw_gather

GATHER - the room folds and everybody is suddenly close
Within:

function phantoms_keep:boss/void_weaver_tick, as him, at him

Desc:

Pulls TO him rather than teleporting him about, so the fight keeps a centre. The
distance gate on the caller is 6..24 - nobody already in melee is dragged, so it is a
move against kiting rather than a move against everyone.

vw_thread

phantoms_keep:boss/vw_thread

THREAD - a line pulled taut between him and you
Within:

function phantoms_keep:boss/void_weaver_tick, as him, at him

Desc:

Drawn with `positioned ^ ^ ^n` stepping along his own facing after `facing entity`, so
the line genuinely points at the target rather than being four separate puffs. Anyone
standing on it is cut.
ANCHORED EYES ON THE FACING, feet on the walk: the local axes are re-resolved at every
`positioned`, and mixing the two anchors is what makes a straight line come out bent.

vw_thread_step

phantoms_keep:boss/vw_thread_step

One segment of the thread
Within:

function phantoms_keep:boss/vw_thread and itself

Desc:

Recurses up the line, sixteen segments, ending on the count rather than on a distance
so it cannot run away in an open room. Damage is applied per segment to whoever is
standing on that segment, so being clipped by the end of the line hurts as much as
being run through by the middle - which is correct, it is a thread, not a spear.

check

phantoms_keep:bulb/check

Read the two rings off their own markers

- per-keep state;
Within:

function phantoms_keep:bulb/tick
because a radius sort put the 4+8+4 pattern in the middle and read the room's
corner plates as decoration. They are not: each corner is a diagonal double door
with a plate either side, one outside over mossy stone and one inside over a bulb.
The four INSIDE plates are the outer ring; the sixteen of the pattern are the inner.
MARKERS, NOT OFFSETS. The sixteen are symmetric about the room's centre so offsets
would have survived rotation - but the four corners are centred on a half-block,
and no set of integer offsets from an integer marker can be symmetric about that.
They would land a block out in three keeps of every four. A marker baked into the
structure rotates WITH it, so there is nothing to compute, and it gives the
shimmer an exact spot to stand on.
The lighting is untouched vanilla: a pressure plate weakly powers the block beneath
it and a copper bulb toggles on a rising edge. This only ever reads.

fault

phantoms_keep:bulb/fault

Lit out of turn, or a corner let go - the floor goes dark and the sky answers

- per-keep state;
Within:

function phantoms_keep:bulb/check

Desc:

THE BOLT IS REAL, THE FIRE IS NOT ALLOWED TO BE. Java has no NBT to make lightning
cosmetic - checked, it is not in the entity's tag list - so a summoned bolt brings
its whole behaviour: 5 HP, ignition, and fires in a two-block radius on normal and
hard. The damage and the ignition are the punishment and they stay. The world fire
does not: the arena is ringed with spruce logs and dark oak, and a puzzle that can
burn the keep down is a bug however good it looks.
The marker's own phantoms_keep_spark is set here and counted down in bulb/tick,
which douses
fire blocks across the arena for the next few ticks. It has to run for several
ticks rather than once, because the fire is placed by the bolt AFTER this function
returns - sweeping only on this tick would find nothing and miss all of it.
THE PLAYER STILL BURNS. Entity fire is not a fire block, so clearing the world
fire leaves them alight. That is the intended sting: about two and a half hearts
from the strike, then a scramble.
Bulbs are extinguished by setblock rather than by toggling, so the reset is
absolute however they were lit. wasser is cleared too, or no plate would announce
itself on the next attempt.

fit

phantoms_keep:bulb/fit

Fit markers to this keep's bulbs, upgrading the bulbs if they are old

- per-keep state;
Within:

function phantoms_keep:bulb/tick, at the arena marker, once per keep

Desc:

TWO JOBS, AND THE ORDER MATTERS. Every candidate is first upgraded from
oxidized_copper_bulb to waxed_copper_bulb, and only then tested for a marker.
WHY THE UPGRADE EXISTS. The bulbs were changed to waxed copper because an oxidized
bulb emits light level 4 when lit against a fresh one's 15 - a lit plate was
putting out almost nothing. But that swap was made in main_keep.nbt, which only
reaches keeps generated AFTERWARDS. Every keep already in the world kept its
oxidized bulbs while bulb/check started looking for waxed ones, so nothing matched,
no markers were placed, nothing shimmered, and the puzzle became unsolvable. The
fix has to travel to the blocks rather than waiting for new terrain.
ROTATION IS HANDLED BY TESTING, NOT BY COMPUTING. Each candidate is checked for an
actual bulb before anything happens, so offsets belonging to a different keep
orientation simply find stone. Nothing has to be derived and no branch chosen.
The sixteen inner offsets are closed under a 90 degree turn, so one set covers all
four orientations. The four corner plates sit on a half-block centre and are not,
so all four of their rotations are listed - sixteen candidates for four real bulbs.
upgrade first - an old keep's bulbs are oxidized and emit almost no light

outer_done

phantoms_keep:bulb/outer_done

The outer circle is complete

- per-keep state;
Within:

function phantoms_keep:bulb/check, at the arena marker

plate

phantoms_keep:bulb/plate

One plate: shimmer while lit, speak when it first lights
Within:

function phantoms_keep:bulb/check, as each bulb marker, at it

Desc:

THE SHIMMER IS CONTINUOUS, THE LINE IS AN EDGE. phantoms_keep_wasser remembers
whether this plate was lit on the previous pass, so the cyan line fires once as it
comes on rather than five times a second forever. The shimmer itself redraws every
pass, which is what makes a lit plate stay visibly lit instead of flashing once and
going quiet.
Blue rising with sparkles in it: soul_fire_flame is the cold blue body,
end_rod the sparkle, and pale cyan dust fills the column so it reads as a shaft of
light from across the room. The upward delta on all three is what makes it climb
rather than sit on the floor.

plate_lit

phantoms_keep:bulb/plate_lit

This plate has just come alight
Within:

function phantoms_keep:bulb/plate, as the marker, at it

Desc:

A burst on the rising edge, and a cyan line naming how far along its ring is. The
counts come from the pass bulb/check has just finished, so the number is current
rather than one behind.

solved

phantoms_keep:bulb/solved

Both circles burning - something answers the signal

- per-keep state;
Within:

function phantoms_keep:bulb/check, at the arena marker

Desc:

THE GATE-CAPTAIN. Rings of light on a keep's high floor are signal fires, and he
is the one who would come when they were lit. Change the ritual tag to move it.
Reuses the altar's ritual marker, same as the bells and the candles, so it
inherits the eighty-tick summon for free.

spark_step

phantoms_keep:bulb/spark_step

Put out what the bolt set alight, in this keep only
Within:

function phantoms_keep:bulb/tick, as the arena marker, at it

Desc:

A summoned bolt places its fire AFTER the summoning function has returned, so a
single sweep on the faulting tick would find nothing. Eight ticks of sweeping
catches all of it. Bounded to the arena, so a campfire elsewhere is never touched.

tick

phantoms_keep:bulb/tick

The two circles in the upper arena

- per-keep state;
Within:

tag/function minecraft:tick

Desc:

Four ticks between reads. That is fast enough for the shimmer to look continuous
and for the chime to land as your foot goes down, and it costs two selector passes
over twenty markers - nothing, and only while somebody is in the keep.
phantoms_keep_bulbphase: 0 waiting on the four corners, 1 waiting on the sixteen,
2 solved. It re-arms when the keep empties, so the floor can be run again.
THE FIRE SWEEP RUNS UNCONDITIONALLY while sparkclean is up, not inside the fault.
A summoned bolt places its fire after the summoning function has returned, so a
sweep in bulb/fault would look at the floor before there was anything to find. Two
thirds of a second of sweeping catches all of it, and it is bounded to the arena
so a campfire somewhere else in the keep is never touched.

check

phantoms_keep:candle/check

Is there a candle on each of the four pads?
Within:

function phantoms_keep:candle/tick, at the phantoms_keep_arena_upper marker

Desc:

Sixteen green glazed terracotta sit in four 2x2 pads, one per quadrant of the
upper arena. The puzzle is one candle on each pad - any colour, any count - which
is why every check is against #minecraft:candles rather than a specific block: the
tag covers all seventeen types, so a plain candle and a purple one both count.
ROTATION TAKES CARE OF ITSELF HERE. The four pads sit at (+/-4..5, +/-4..5) around
the centre, a set that maps exactly onto itself under a 90 degree turn. Which pad
ends up "north-west" changes from keep to keep, but the QUESTION - is there a
candle on all four - does not. So unlike the bells, this needs no four-way branch.
A pad scores 1 if ANY of its four blocks is lit, so players do not have to guess
which corner of the pad matters.

solved

phantoms_keep:candle/solved

All four corners lit - the watch is relieved

- per-keep state;
Within:

function phantoms_keep:candle/check, at the arena marker

Desc:

Reuses the altar's ritual machinery exactly as bell/solved does: a marker carrying
the position and the countdown, and boss/ritual owns the eighty ticks of build-up.
Any trigger can drop that marker, which is what lets a puzzle raise a boss without
a relic - and means this puzzle inherits the summon animation for free.
THE HOLLOW PHANTOM, because this is the open upper arena with the sky over it and
he is the one who flies. Change the ritual tag on the summon line to move it.
Latched immediately, so the eighty ticks of ritual cannot re-trigger the check
twenty times on its way to the boss.

tick

phantoms_keep:candle/tick

The four pads in the upper arena

- per-keep state;
Within:

tag/function minecraft:tick

Desc:

Costs nothing until somebody is actually up there: the whole thing is gated on a
player being within 24 of the arena marker, and even then it only looks every 20
ticks. Candles do not appear between one tick and the next, and a second of delay
on a puzzle nobody is racing is not a delay anyone can feel.
Silent once solved. phantoms_keep_candledone latches when the boss is called, so
the cryptic line stops nagging and the check stops running - it re-arms when the
arena empties, the same way the bells do.

whisper

phantoms_keep:candle/whisper

The room asks for light, without saying so
Within:

function phantoms_keep:candle/tick, at the arena marker

Desc:

Cryptic, per the design note - it should read as the building talking rather than
as a quest marker. Never names candles or corners; a player who looks at the green
floor and the four pads has everything they need.

arm

phantoms_keep:floor/arm

The keep notices you standing on its signal floor

- per-keep state;
Within:

function phantoms_keep:floor/tick, at the arena marker

Desc:

THE PRE-PUZZLE. The upper arena generates as a wooden checkerboard, and the floor
turning to stone is the first thing that happens to you up there - before a single
plate is pressed. The keep has done this before. It knows what gets called when
the circles are lit, and it knows what that costs a wooden floor.
It is also load-bearing rather than decoration: a fault calls lightning, and
lightning starts fires in a two-block radius. Converting the floor first means the
punishment can be as violent as it likes without burning the room down. The
animation and the fireproofing are the same act, which is the neatest possible
reason for it to exist.

done

phantoms_keep:floor/done

The whole floor is stone now

- per-keep state;
Within:

function phantoms_keep:floor/step, at the arena marker

Desc:

State 2 is "armoured". floor/tick stops stepping, and the fault can call as much
lightning as it likes without a plank left to catch.

fall

phantoms_keep:floor/fall

The boss is down, and the keep lets the boards back up
Within:

function phantoms_keep:boss/cleanup, as the arena marker, at it

Desc:

State 3 is 'reverting'. floor/tick steps it exactly as it steps the conversion,
through floor/unrows instead of floor/rows.
ONLY FROM STATE 2. A keep whose floor never converted has nothing to put back, and
running the reverse wave over untouched wood would fill nothing 135 times.
phantoms_keep_bosswas is what makes this a DEATH rather than an absence. cleanup
runs every tick and 'no boss present' is true almost always, so without an edge
the floor would revert the moment it finished converting. The score is raised
while a boss stands in this keep and read on the tick it stops standing.

rows

phantoms_keep:floor/rows

One step of the wave - the two rows at distance d from the middle

- per-keep state;
Within:

function phantoms_keep:floor/step, at the arena marker

Desc:

TWO PASSES, BONES THEN SKIN. The spruce-log lines radiating across the floor go
first, turning to basalt over steps 1-14; the slab checkerboard follows over steps
15-28. The structure of the floor sets itself and then the surface fills in behind
it, which reads as the keep rebuilding rather than a wipe. One pass converting
everything at once looked like a texture swap.
ROW BY ROW, NOT A GROWING SQUARE. The room is a diamond and there is more wood at
the same height in the corner towers, the nearest at square radius 11, so no square
covering the room misses it. These extents come from a flood fill of the real room:
576 blocks, 27 rows, x 7..33 by z 7..33.
THE INDEX IS OFFSET BY ONE. floor/step increments floorr BEFORE consulting this, so
floorr is never 0 and a table keyed on raw distance would skip the centre row for
ever.
PASS ONE - the basalt lines

step

phantoms_keep:floor/step

One ring of the floor turns to stone

- per-keep state;
THE PITCH RIDES THE DISTANCE. Every row speaks, and the pitch climbs from 0.63 to
1.02 as the wave opens outward, which is what turns fourteen identical stone sounds
into one continuous sweep instead of a stutter. `store result ... double 0.01` is
what makes that possible: scoreboards hold only integers, so the pitch is computed
as 60+3d on the board and scaled on the way into storage.
tick

phantoms_keep:floor/tick

The signal floor arms itself when somebody comes up

- per-keep state;
Within:

tag/function minecraft:tick

Desc:

State 0 wooden and waiting, 1 turning, 2 stone. Arming is triggered by presence
alone - no plate, no candle, nothing pressed - so the floor changing is the first
thing the room does to you, and it lands as the keep reacting rather than as a
reward for solving anything.
arming RETURNS. floor/arm sets the state to 1, which the step line below then
reads - so without the return the floor would arm and lay its first ring on the
same tick. Harmless in itself, but it is the D62 shape, and the cost of closing it
is one skipped clock increment on the tick you walk in.
It does NOT re-arm when the keep empties. Once the boards are gone they are gone;
a floor that turns back into wood behind you would say the keep forgot, and the
whole point of the animation is that it did not.

undone

phantoms_keep:floor/undone

Wood again, and the keep waits to be left alone
Within:

function phantoms_keep:floor/unstep, at the arena marker

Desc:

STATE 4, NOT 0, and that is the whole point of this file. State 0 is 'armed and
waiting', and floor/tick arms on a player being within 16 - so dropping straight
to 0 with the player still standing on the boards they just watched come back
would re-convert the floor on the very next tick, for ever.
4 means 'reverted, waiting for the room to empty'. floor/tick releases it to 0
once nobody is within 48, so the next party through gets the animation from the
top exactly as the first one did.

unrows

phantoms_keep:floor/unrows

The boards come back, from the outside in
Within:

function phantoms_keep:floor/unstep, at the arena marker

Desc:

THE EXACT INVERSE of floor/rows: same 27 rows, same extents, the two block
arguments swapped, and the step order reversed so the wave closes inward
instead of opening outward. Generated from rows.mcfunction rather than
written by hand, so the two cannot drift apart.
THE FILTER IS THE FULL STATE. What the conversion PLACED was
polished_deepslate_slab[type=top,waterlogged=false], so that is what has to
be matched to find it again. What goes back is dark_oak_slab[type=top],
which defaults waterlogged to false - the same block the keep started with.
Slabs first, then the basalt lines, because reversing the step order
reverses the two passes as well. The last thing to go is the first thing
that came, which is what makes it read as undoing rather than as a
second, different animation.
step 1

unstep

phantoms_keep:floor/unstep

One ring of the floor goes back to wood
Within:

function phantoms_keep:floor/tick, at the arena marker

Desc:

Mirrors floor/step. The pitch runs the other way - down from 1.02 to 0.63 as the
wave closes in - which is the whole trick that makes it read as the same sound
played backwards rather than as a second effect.
#pitch = 60 + 3 * (29 - floorr), scaled by 0.01 on the way into storage, because
scoreboards hold only integers and playsound wants a fraction.

voice

phantoms_keep:floor/voice

The sound and dust of one step of the wave
Within:

function phantoms_keep:floor/step, with storage phantoms_keep:floor ring

Desc:

Quiet on purpose. Eighteen rings at full volume is a demolition; this is the
building doing something small and deliberate while you happen to be standing on
it. Nothing above 0.32, and the whole sweep is a fraction of the strike that can
follow it later.

bacon

phantoms_keep:keep/bacon

Bacon picks a corner
Within:

function phantoms_keep:zone/inside, AS this keep's arena marker, AT it

Desc:

One baby hoglin per keep, in one of the four corners of the courtyard at random, so no
two keeps put him in the same place and finding him is worth something.
ON ENTRY, NOT ON GENERATION. keep/init runs when the chunks load, which can be long before
anyone arrives - Bacon would spend that time wandering off or being eaten by his own ward.
THE LATCH LIVES ON THE ARENA MARKER, per keep, never a fake player (D63), and it is set
BEFORE the roll so two players walking in on the same tick cannot produce two piglets.
WHY 56 BLOCKS DIAGONAL. The ward is a ring - radius 44 to 68 where the corner turrets
pinch it, 40 to 70 along the straights. 56 is the middle of the tightest part, so one
offset lands inside the ward at every corner and clear of both walls.

bacon_drop

phantoms_keep:keep/bacon_drop

Bacon
Within:

function phantoms_keep:keep/bacon_find, positioned on the floor it found

Desc:

A PERMANENT PIGLET. Age -2147483648 is the never-grow value: a hoglin is an ageable mob and
a plain baby matures into an ordinary adult in about twenty minutes, which would quietly
delete the trigger and leave a stray hoglin in the ward instead.
IMMUNE TO ZOMBIFICATION for the same reason his parent is - fifteen seconds in the
overworld and he is a baby zoglin, losing the tag everything else matches on.
PLACED ON THE FLOOR, not dropped onto it. He keeps fall_damage_multiplier 0 anyway: he is
standing in a ward full of houses he can be shoved off, and a boss trigger that can die to
a two-block fall is a boss trigger that will.
NOT REPLACED IF KILLED, which is the point - he is the one free summon a keep gives you.
After that the Razorback is called with its tusk like every other boss.

bacon_find

phantoms_keep:keep/bacon_find

Find the floor under the chosen corner
Within:

function phantoms_keep:keep/bacon, and itself, AS the arena marker

Desc:

Walks down to the first real surface so Bacon can be PLACED rather than dropped.
THREE CASES, IN THIS ORDER, and the order is the whole function:
1. standing inside a solid block -> rise one. Starting inside a house or a hillside is
the case a downward-only scan gets wrong, burying him in stone.
2. solid block underfoot -> this is the floor. Place him and stop.
3. otherwise -> step down one and repeat.
BOUNDED AT 48 STEPS. The marker sits about 24 blocks above the ward floor, so 48 is twice
what is needed; a scan that exhausts places nobody rather than recursing toward the
command limit. The counter is on the arena marker, so it is per keep like everything else.

bacon_gone

phantoms_keep:keep/bacon_gone

Bacon is no longer in the ward
D13
Within:

function phantoms_keep:zone/inside, AS this keep's arena marker, AT it

Desc:

Fires once, when a keep that HAD a Bacon no longer has one - however he went. Eaten by a
husk, shot by a skeleton, or killed by the player: the parent comes either way, which is
both more robust than an advancement and better behaved than one.
LATCHED SEPARATELY FROM baconup. "A Bacon was made here" and "his parent has been called
here" are different facts; one score for both would let a keep summon the Razorback twice
or never, depending which way it was written.
The guards match boss/bacon_died exactly, so whichever route fires second does nothing.

at

phantoms_keep:keep/death_vault/at

Go to where they died, and find that keep's death vault
Within:

function phantoms_keep:keep/death_vault/died, as the dead player

Desc:

`at` moves the POSITION only - @s stays the dead player, which is what every item
replace and the final clear need.
160 is per-keep safe: the structure set is spacing 44 / separation 14, so keeps sit
at least 480 blocks apart and anything under 240 cannot reach a neighbour's room
(D63). lore/tick already uses this bound.
If no anchor is in range - no room, chunk not loaded - the execute does nothing and
the player keeps everything. That is the correct failure.

died

phantoms_keep:keep/death_vault/died

Somebody just died
Within:

function phantoms_keep:keep/death_vault/tick, as the dead player

Desc:

THE MARK IS STAMPED FIRST, before anything can fail. If the room is missing, the
chunk unloaded or every cell full, this must still not run again next tick - the edge
has been consumed either way.
THE STORED POSITION, NOT @s. With doImmediateRespawn on - or simply a fast click -
the player is standing at world spawn by the time this runs, and searching 160 blocks
around spawn finds nothing. zone/inside stamps their last known in-keep position once
a second, so it is at most a second stale, which against a 160-block radius is
nothing.

fill_a

phantoms_keep:keep/death_vault/fill_a

Half A - hotbar and the first eighteen inventory slots
Within:

function phantoms_keep:keep/death_vault/take, as the dead player, at cell A

Desc:

`item replace block ... from entity` rather than `data modify ... Items set from
entity @s Inventory`, and the difference is fourteen destroyed stacks. Inventory
entries carry a Slot byte - armour is 100-103, offhand is -106, main inventory runs
0-35 - but a chest block entity has only slots 0-26 and silently discards every entry
outside that range when it loads. item replace addresses slots by index, so the
source's Slot byte never enters into it.
The hotbar lands on the chest's top row, which is how it reads when opened.

fill_b

phantoms_keep:keep/death_vault/fill_b

Half B - the rest of the inventory, the armour, the offhand, and whose it was
Within:

function phantoms_keep:keep/death_vault/take, as the dead player, at cell B

Desc:

THE HEAD IN SLOT 26 IS NOT DECORATION - it is the only route to the player's NAME. A
player's display name lives in their GameProfile and not in saved NBT, so
`data modify ... from entity @s <path>` cannot reach it at all. fill_player_head with
entity "this" stamps the profile of whoever the loot context is running as, and the
name reads straight back out of the stored component. It also labels the chest for
anybody who opens it.

label

phantoms_keep:keep/death_vault/label

Read the owner's name back off the head
Within:

function phantoms_keep:keep/death_vault/take, at cell B

Desc:

The profile component is written by fill_player_head one step earlier in the same
tick, so it is readable here. If 26.2 stores minecraft:profile as a bare string
rather than a compound, drop the trailing `.name` - PLAYTEST ITEM 3.

name

phantoms_keep:keep/death_vault/name

Put the owner's name on the cell
Within:

function phantoms_keep:keep/death_vault/take, at cell A

Desc:

CustomName on a block entity is a text component COMPOUND since 1.21.5, not a quoted
JSON string - boss/summon_archivist already proves the 26.2 shape.

overflow

phantoms_keep:keep/death_vault/overflow

Every cell is full
Within:

function phantoms_keep:keep/death_vault/scan_try, as the dead player

Desc:

NOTHING IS CLEARED AND NOTHING IS OVERWRITTEN. The user's rule: never delete anyone's
loot. A full room means the keep simply cannot take any more, and death falls back to
the world's own keepInventory. Making it meaner later is a one-line change; you
cannot un-delete somebody's netherite.

scan

phantoms_keep:keep/death_vault/scan

Look for a free cell, starting at the first
Within:

function phantoms_keep:keep/death_vault/at, as the dead player, at the room anchor

scan_step

phantoms_keep:keep/death_vault/scan_step

Hand the current cell number to the macro
Within:

functions phantoms_keep:keep/death_vault/scan and .../scan_try

scan_try

phantoms_keep:keep/death_vault/scan_try

Is this cell free?
Within:

function phantoms_keep:keep/death_vault/scan_step, as the dead player, at the anchor

Desc:

`if block ~ ~ ~ #phantoms_keep:cell_chest` IS THE MOST IMPORTANT GUARD HERE.
`unless data block <pos> Items[0]` on a block that is not a container returns false,
so `unless` is true - a griefed or missing chest reads as an EMPTY CELL. Without a
positive test that the block really is a chest, the pack would copy 41 stacks into
nothing and then clear the player. The tag makes that impossible; take's proof check
is the second net behind it.
BOTH HALVES ARE TESTED. A player who emptied half A and left half B would otherwise
have their remaining armour overwritten by the next casualty.
`return run` then fall through is the if/else form the guard audit prescribes: the
branch that matches ends the function, so nothing below can read what it wrote.
Two players dying on the same tick are safe by construction - the @a loop in tick is
sequential and block entity writes land immediately, so the second player sees cell 1
as full and takes cell 2.

strip

phantoms_keep:keep/death_vault/strip

Everything landed - now take it off them

`clear @s` empties main inventory, armour and offhand: exactly the 41 slots that were
transferred, and nothing else.
take

phantoms_keep:keep/death_vault/take

This cell is free - take everything
Within:

function phantoms_keep:keep/death_vault/scan_try, as the dead player, at the anchor

Desc:

Half A takes the hotbar and the first eighteen inventory slots, half B the remaining
nine plus armour and offhand. 9 + 18 + 9 + 4 + 1 = 41, which is a full player.
THE TWO `if data` LINES ARE PROOF THAT SOMETHING LANDED. Only then is the player
cleared. Both halves have to be checked because a player who died carrying nothing
but armour puts nothing at all into half A. item replace copies rather than moves,
which is why an explicit clear is needed and why it must be earned.

tick

phantoms_keep:keep/death_vault/tick

Has anybody died who had not died a moment ago?
Within:

tag/function minecraft:tick

Desc:

EVERY TICK, not throttled. The window between dying and clicking Respawn is short and
the whole point is to take the inventory before the player walks off with it. The
cost is two @a passes with no predicate, no NBT read and no structure lookup - the
same shape zone/zone_check already pays.
LINE ONE IS NOT DECORATION. phantoms_keep_deathmark is a dummy, so it is UNSET for a
player who has never died, and `unless score @s A = @s B` is TRUE when either side is
unset - a brand new player would be robbed the moment they joined. `add 0` seeds it
without disturbing anyone who already has a value. Same trap keep/init documents.
deathmark, NOT deaths_seen: boss/engage already owns deaths_seen as its per-fight
baseline, and sharing it would break the boss gate in both directions.

guardpost

phantoms_keep:keep/guardpost

The Household Guard's post
Within:

function phantoms_keep:keep/gus_post, positioned eight blocks from Gus

Desc:

Where it stood for ninety years, waiting to check a list. Iron underfoot, a lantern on a
post, and the marker boss/resident_died raises the Guard from.

gus

phantoms_keep:keep/gus

Gus takes a different corner
Within:

function phantoms_keep:zone/inside, AS this keep's arena marker, AT it

Desc:

The last of the household, still standing in the yard, considerably larger than he was.
A DIFFERENT CORNER FROM BACON, BY CONSTRUCTION. Bacon's roll is still on this marker in
phantoms_keep_roll, so Gus takes that value and adds two, wrapping - the opposite corner,
every time. Rolling independently would put them together one time in four and hand a
player both bosses in one spot.
Same latch discipline as Bacon: set before the placement so two players entering on the
same tick cannot produce two of him, and per keep on the arena marker, never a fake
player (D63).

gus_find

phantoms_keep:keep/gus_find

Find the floor under Gus's corner
Within:

function phantoms_keep:keep/gus, and itself, AS the arena marker

Desc:

Identical to keep/bacon_find and for the same reason: place him on the ground rather than
dropping him onto it. Three cases in order - inside a block, rise; solid underfoot, place;
otherwise step down - each of the first two ending in `return run` so exactly one fires
per step (D62). Bounded at 48 so an impossible column places nobody rather than recursing
toward the command limit.

gus_gone

phantoms_keep:keep/gus_gone

Gus is gone, and the household is counted
Within:

function phantoms_keep:zone/inside, AS this keep's arena marker, AT it

Desc:

Fires once, when a keep that HAD a Gus no longer does - however he went.
ABSENCE, NOT AN ADVANCEMENT, for the same reason Bacon uses it: the advancement route has
and it is the better rule anyway. If a husk eats the last of the household, the machine
built to protect the household should still come.

gus_place

phantoms_keep:keep/gus_place

Gus
Within:

function phantoms_keep:keep/gus_find, positioned on the floor it found
so a player connects killing him to what arrives, but he must not be a fight in his own
right - the fight is the thing he summons. 20 HP, scale 1.6, and no weapon.
A HELMET SO HE DOES NOT BURN, AND IT IS UNBREAKABLE. He stands in an open yard; without
a hat he is gone at the first sunrise and the keep's only free Guard summon goes with him.
A PLAIN helmet is not enough: in Java, headgear worn by an undead takes durability damage
every time it saves them from the sun, so an ordinary leather cap wears through in a few
days and Gus burns on the morning after it breaks - a delayed version of exactly the trap
that would have deleted Bacon by letting him grow up. Unbreakable, and drop_chances 0 so
killing him does not hand the player a free unbreakable hat.
Speed is deliberately low. He should shamble, be findable, and be killable on purpose
rather than in self-defence - the whole point is that killing him is a DECISION.

gus_post

phantoms_keep:keep/gus_post

Gus's yard, and the Guard's post beside it
Within:

function phantoms_keep:zone/inside, AS Gus, AT him, once he is standing on something

Desc:

A low stone yard so he stays where he was put and can be found again, and a post eight
blocks off that carries the marker the Household Guard rises from.
The mirror of Bacon's pen and wallow, and for the same reasons: a summon target that
wanders is a summon target you cannot find, and a boss that appears at the killer's own
feet gives no warning and no room. You can see where the Guard will come from before you
decide anything.
Every fill is `replace minecraft:air` - the ward is full of houses and a yard that lands
against one should lean on the wall rather than punch through it.

init

phantoms_keep:keep/init

Seed one keep's puzzle state on its own arena marker

An arena marker is baked into each keep's structure, so holding the state on it
is per-keep with nothing to compute and nothing to clean up. Entity scores are
keyed by UUID and survive the chunk unloading, which is exactly right: a keep
whose floor has gone to stone should still be stone when you come back.
pen

phantoms_keep:keep/pen

The pen goes up around Bacon
Within:

function phantoms_keep:zone/inside, AS Bacon, AT him, once he has landed

Desc:

Five by five, one fence high, gate on the north side, latch set so it never runs twice.
EVERY FILL IS `replace minecraft:air`. The ward has houses in it now: a pen that lands
against one leans on the wall rather than punching through it, and a side that is already
solid simply stays solid. Nothing is destroyed to build this.
THE INTERIOR IS NEVER FILLED - four side fills rather than one `hollow` fill, because
hollow still writes air into the middle, and the middle is where Bacon is standing.

wallow

phantoms_keep:keep/wallow

The Razorback's wallow
Within:

function phantoms_keep:keep/pen, positioned eight blocks from Bacon

Desc:

Churned ground, a rib in the dirt and a post with a soul lantern - the den the boar has
been using for ninety years. It is dressing AND a mechanism: the marker summoned here is
where boss/bacon_died raises the Razorback.
WHY IT IS NOT WHERE THE PLAYER IS STANDING. The Razorback used to rise at the killer's own
feet, which gave a charging boss no room to charge and gave the player no warning at all.
Rising from a marked den eight blocks away means you can see where it will come from
before you touch the piglet, and the fight opens with distance between you - which is the
entire premise of a boss whose best move is a run down a lane.
The marker is PersistenceRequired by nature - markers never despawn - and one per keep,
because it is only ever summoned from the pen, which is latched.

load

phantoms_keep:load

Phantom Keep - one-time setup
Within:

tag/function minecraft:load

Desc:

Creates the boss cooldown objectives and the gamemode store for the keep zone.
Safe to re-run: `scoreboard objectives add` on an existing objective is a no-op
that logs a failure, so each is guarded.

stock

phantoms_keep:lore/stock

Put the keep's own books on its shelves
Within:

function phantoms_keep:lore/tick, as an unstocked shelf marker, at it

Desc:

Nine lore books already exist as loot tables - the Mason's confession, the
Gate-Captain's orders, the thief's account of the empty court - and until now the
only way to read one was to find it in a vault. A chiseled bookshelf standing empty
in a keep full of writing is a missed opportunity, so each one gets two of them,
rolled independently, and different in every keep.
THE BLOCKSTATE HAS TO BE SET SEPARATELY, and that is the awkward part. A chiseled
bookshelf shows its books through slot_N_occupied, which vanilla only ever sets
when a PLAYER puts a book in. Filling the container with /loot leaves the state
false, so the books are really there and the shelf still looks bare.
setblock is the only way to change it, and setblock wipes the block entity - so the
order is forced: state first, contents second. facing has to be carried across by
hand, which is why there are four branches for what is otherwise one command.
Slots 0 and 3 are the top-left and bottom-left cubbies, so the pair reads as two
books leaning in the same shelf rather than a set someone tidied.

stock_roll

phantoms_keep:lore/stock_roll

Roll two of the nine, independently
Within:

function phantoms_keep:lore/stock, at the shelf

Desc:

Two rolls, not one pick of two, so a shelf can hold the same title twice - a keep
that copied one book more often than the others is a better detail than a tidy set.
`loot replace block` fills the container slot from the very loot table the vaults
use, so the book in the shelf and the book in the vault are the same object. Nothing
is duplicated here and nothing can drift out of step when the lore is edited.

tick

phantoms_keep:lore/tick

Stock any chiseled bookshelf that has not been stocked yet
Within:

tag/function minecraft:tick

Desc:

Once every five seconds, and only when somebody is in a keep. A shelf is stocked
once and tagged, so this converges to a single selector query that finds nothing -
the same shape as the bell hitbox fitter.
It runs at runtime rather than being baked into the structure for two reasons: the
books come out different in every keep, and the shelves live in RANDOM decoration
slots, so there is no fixed position to bake anything into. The marker travels with
the decoration piece wherever the jigsaw puts it.

done

phantoms_keep:rite/arch/done

The record is in order
Within:

function phantoms_keep:rite/arch/read, as the shelf marker, at it

Desc:

The seventh slot is the one that stays empty. A chiseled bookshelf has six, the case
needs six, and the thing that answers comes from the place where a seventh would go.

mark

phantoms_keep:rite/arch/mark

Another volume sits right
Within:

function phantoms_keep:rite/arch/read, as the shelf marker, at it

Desc:

`said` is the edge latch. Without it the shelf would announce its count ten times a
second for as long as anybody stood in the room.

read

phantoms_keep:rite/arch/read

Six slots, six volumes, in order
Within:

function phantoms_keep:rite/arch/watch, as the shelf marker, at it

Desc:

MATCHED BY TAG, NOT BY TITLE. Every volume carries
components.minecraft:custom_data.phantoms_keep_vol, the same way every relic carries
phantoms_keep_call. Matching on written_book_content.title.raw would work today and
break the first time a title is reworded, and it cannot survive translation.
An NBT path with a compound filter tests existence of a MATCHING element, so one line
per slot answers both "is the right volume here" and "is it in the right place".

tick

phantoms_keep:rite/arch/tick

The archive chamber, per tick
Within:

tag/function minecraft:tick

Desc:

Every chamber ticks itself, never limit=1, and every selector is bounded to 24 - four
arenas per keep sit 30 to 100 blocks apart (D63). Read-before-write ordering as
everywhere else: the re-arm sweep tests the same `entity @a[distance=..24]` the watch
sweep does, so the two are a plain if/unless pair rather than two radii that happen
not to overlap (D62).

watch

phantoms_keep:rite/arch/watch

Read the shelf
Within:

function phantoms_keep:rite/arch/tick, as the chamber marker, at it

Desc:

Once every ten ticks rather than every tick. A chiseled bookshelf can only change when
a player interacts with it, and half a second of lag on a puzzle nobody is racing is
not lag anybody can feel - but six NBT path tests twenty times a second, times four
arenas, is real work for nothing.

cleared

phantoms_keep:rite/cells/cleared

The last of them stops moving
Within:

function phantoms_keep:rite/cells/tick, as the room marker, at it

Desc:

THE PAYOUT IS A DIFFERENT BOSS. Not loot - the Broodmother's Eye, which is the relic
that calls her at any altar. The room does not reward you with a thing, it rewards you
with somewhere else to go, which is the only reward a room this hard to find can
usefully give.
`loot spawn` from the pack's own table rather than a hand-written give, so the Eye is
byte-identical to the one the vaults roll - the altar matches on custom_data and an
item that merely looks right summons nothing. That defect is D1 and it is still open
for the boss drops; there is no reason to add an eleventh instance of it here.
Latched to 3 - sprung and paid - so the drop cannot repeat while the player is still
standing in the room. rite/cells/recount puts it back to 0 once they leave.

done

phantoms_keep:rite/cells/done

All sixteen lit - and the cells empty at you
Within:

function phantoms_keep:rite/cells/watch, as the room marker, at it

Desc:

THE TRAP IS SPRUNG BY GREED, not by cleverness. Lighting every candle is the thing a
player does without thinking; leaving one dark is the thing they do after reading the
Register and working it out. Only the first one is punished here.
FIVE TO SEVEN, ROLLED. `limit=N,sort=random` picks that many candle posts and drops
one spider from each, so the count varies and so does where they come from - a fixed
set of spawn points would be learned in two runs.
Darkness rather than blindness, for three seconds: it pulses rather than smothering,
so it reads as the room closing over you rather than as the screen going off. Long
enough that they land before you can see them, short enough that the fight is fair.
Latched to 2 first, so the ambush cannot re-fire while the spiders are still alive and
the candles are still lit.

douse_one

phantoms_keep:rite/cells/douse_one

Put this candle block out WITHOUT flattening it
Within:

function phantoms_keep:rite/cells/recount, as a cell marker, at it

Desc:

room_1's candle blocks are NOT single candles. Twelve of them hold three and four hold
four - that is what the structure NBT says - and there is no command that extinguishes
a candle in place, so putting one out means a setblock, and a setblock has to state
the count. Writing `candles=1` was flattening every cluster to a single candle the
first time the room re-armed, permanently.
Four lines, one per count, and each writes back the SAME count it tested - so a line
that fires cannot make a later line's test true. Safe by structure, not by the order
happening to work out (D62).

dress

phantoms_keep:rite/cells/dress

Decide which cell was never used, and wear the other three in
Within:

function phantoms_keep:rite/cells/watch, as the room marker, at it

Desc:

Rolled per room and then latched, so the answer differs between the six copies of
room_1 in a keep. A baked answer would be learned on the second room and the rite
would be over for the rest of the world.
The wear is cobweb at floor level under each real post - which is exactly what Fenn
says to look for, so the tell in the book and the tell in the room are the same object
rather than two things that have to be kept in sync by hand.
THE FALSE POST IS CLEARED WITH , NOT . setblock takes a MODE and
nothing after it, so is a parse error that
would have killed this whole function at load - the same defect this pack shipped
twice before. fill takes a real filter, and a one-block fill is the correct way to say
'remove only the cobweb, leave whatever else is there'.

recount

phantoms_keep:rite/cells/recount

The muster is recanted mid-fight
Within:

function phantoms_keep:boss/mm_recant, as a hold marker, at it

Desc:

Douses every candle, clears the wear, and un-latches the dressing so the next watch
pass rolls a NEW false cell and re-dresses the room. The answer you worked out before
the fight is now wrong, which is the whole joke.

state

phantoms_keep:rite/cells/state

Armed, sprung, or paid?
Within:

function phantoms_keep:rite/cells/tick, as the room marker, at it

Desc:

EXISTS ONLY TO MAKE THE IF/ELSE REAL, exactly as rite/heart/state does. As two lines
in tick these were a guard-then-reread: cleared writes cellson 3 and the watch line
underneath tests `unless cellson matches 2..`. It cannot misfire, because 3 is inside
that range - but that is safe by ARITHMETIC, which is the shape that made every
correct bell ring also count as wrong (D62). A reader cannot see it and the audit
cannot either.
`return run` settles it by structure: the first branch that matches ends the function,
so the second can never read what the first wrote. Per marker, so ending here ends
this room's turn and no other room's.

tick

phantoms_keep:rite/cells/tick

The hold, per tick
Within:

tag/function minecraft:tick

Desc:

Bounded to 16 - room_1 is 21 across and there are several per keep (D63).
THREE STATES ON cellson. 0 armed. 2 sprung, spiders loose. 3 paid, the Eye is on the
floor. The dispatch into rite/cells/state is what keeps those exclusive by structure
rather than by the happy accident that 3 falls inside `2..`.
RECOUNT NEEDS BOTH TESTS. Without `unless entity @e[...add_cells]` a player who runs
from the ambush re-arms the room with the last spider still chasing them, and walking
back in relights a trap that never finished.

watch

phantoms_keep:rite/cells/watch

Count the candles, post by post
Within:

function phantoms_keep:rite/cells/tick, as the room marker, at it

Desc:

A post counts as lit only when all four of its candles are. Counting per post rather
than in total is what makes "leave one dark" mean a POST rather than a candle, and it
stops three-and-a-bit posts reading as three.
Every count lands on this room's own marker, never a fake player - six copies of
room_1 per keep and they must not share (D63).

broke

phantoms_keep:rite/heart/broke

Somebody has broken this heart
Within:

function phantoms_keep:rite/heart/fight, as a root marker, at it

Desc:

`return run` on both branches. They are exclusive on the same score, so the first
branch cannot fall through into the second - and a return here ends this root's turn
only, because the caller invoked us per marker rather than in a loop we could abort.

choose

phantoms_keep:rite/heart/choose

Pick the heart that is his
Within:

function phantoms_keep:rite/heart/fight, as the Warden, at him

Desc:

One of the four, at random, and nothing marks it out from the others except its
state - a player has to break one to find out, which is the cost that makes the
choice mean anything.
`creaking_heart_state` is a real block state and the true one does not read dormant,
so a player who thinks to look closely can tell. That is deliberate: the rite rewards
looking, and a boss called The Pale Warden should be beatable by paying attention.

done

phantoms_keep:rite/heart/done

All four roots awake
Within:

function phantoms_keep:rite/heart/watch, as the chamber marker, at it

Desc:

Reuses the altar's ritual machinery exactly as bell/solved and candle/solved do - a
marker carrying the countdown, and boss/ritual owns the eighty ticks of build-up. Any
trigger can drop that marker, which is what lets a rite raise a boss without a relic.
Latched to 2 immediately, so the eighty ticks of ritual cannot re-trigger the check.

drape

phantoms_keep:rite/heart/drape

Hang the strands back up
Within:

function phantoms_keep:rite/heart/rearm, as the chamber marker, at it

Desc:

TOP DOWN, ONE BLOCK AT A TIME, and it has to be. Hanging moss is supported by the
block ABOVE it, so a `fill` up the column places the bottom block first against
nothing and it pops the moment the region updates. Eighteen setblocks per strand
descending from the ceiling is the only order where every block lands on something.
Written out rather than looped because mcfunction has no loop, and a macro
recursion for eighteen blocks costs more to read than it saves to write. This runs
only when the chamber empties, so the line count is not on any hot path.

drip

phantoms_keep:rite/heart/drip

A bead of resin lets go
Within:

function phantoms_keep:rite/heart/moss, as the chamber marker, at it

Desc:

ONE STRAND PER CYCLE, rolled, not all four together. The user asked for very slight,
and four simultaneous drops reads as an effect; one drop somewhere overhead every
two seconds reads as a room. dripping_honey forms and hangs at the tip,
falling_nectar runs down the length - honey because the user noticed it passes for
resin, which is the Warden's own material and what the roots bleed when they wake.

fight

phantoms_keep:rite/heart/fight

Which heart is his, and has anybody broken it?
Within:

function phantoms_keep:boss/pale_warden_tick, as the Warden, at him

Desc:

No block-break event exists for a datapack, so this polls: a root whose block is no
longer a creaking heart has been broken. Four markers checked once a tick is nothing.
`phantoms_keep_gone` is the latch that makes it an EDGE. Without it the same broken
heart would be counted every tick until it regrew, and three wounds would land in
three ticks.

moss

phantoms_keep:rite/heart/moss

The chamber before anything has happened
Within:

function phantoms_keep:rite/heart/tick, as the chamber marker, at it

Desc:

Runs only while the rite is dormant and somebody is actually in the room. Two jobs:weep, and notice when a strand is gone.
ONLY THE BOTTOM BLOCK OF EACH STRAND IS TESTED. Hanging moss is supported from
above, so cutting anywhere up the strand drops everything below it - the tip is
therefore missing whatever height the player swung at, and four block tests cover
four eighteen-block strands. Cheaper and more reliable than walking the columns.
Four separate calls into raise rather than one combined test, because a player can
cut two strands in the same tick. raise latches on its own first line.

raise

phantoms_keep:rite/heart/raise

Somebody cut the moss
Within:

function phantoms_keep:rite/heart/moss, as the chamber marker, at it

Desc:

LATCHED ON THE FIRST LINE, and that matters because moss checks four strands in
sequence and clearing them makes all four read as cut. Without the return, one cut
would raise the roots four times over. The guard is a `return fail` on the state
this function itself writes, so the second call through cannot get past line one.
Every strand falls, not only the one that was cut - the room lets go all at once,
which is the moment the rite actually begins.

rearm

phantoms_keep:rite/heart/rearm

The chamber is empty again
Within:

function phantoms_keep:rite/heart/tick, as the chamber marker, at it

Desc:

The rite is repeatable, because everything in this pack is - the loot revokes its own
advancement for the same reason. The roots go back into the floor, the strands are
hung again, and the room is dormant for whoever comes next.
Runs from riteon 1 as well as 2, so cutting the moss and leaving does not strand the
chamber with its roots up and no way back to dormant.

regrow

phantoms_keep:rite/heart/regrow

The roots close over again
Within:

functions phantoms_keep:rite/heart/wound and .../wrong

Desc:

Every root comes back, the broken latch clears, and the true heart is re-chosen on
the next tick because choose only runs when no root is marked. Regrowing ALL of them
rather than only the broken one is what keeps the hunt honest - otherwise a player
could clear three roots and leave the fourth as a process of elimination.

slip

phantoms_keep:rite/heart/slip

Nobody is keeping this vigil any more
Within:

function phantoms_keep:rite/heart/watch, as a root marker, at it

Desc:

Only this root falls back, and only if it had actually started - the guard keeps the
sound from firing every tick on three roots nobody is near.

state

phantoms_keep:rite/heart/state

Which half of the rite is this chamber in?
Within:

function phantoms_keep:rite/heart/tick, as the chamber marker, at it

Desc:

THIS FILE EXISTS ONLY TO MAKE THE IF/ELSE REAL. As two lines in tick they were a
guard-then-reread: watch reaches done, which writes riteon 2, and the moss line
underneath tests riteon again. It is safe - 2 is inside `1..` so moss stays excluded
- but safe by arithmetic, which is precisely the shape that made every correct bell
ring also register as wrong (D62). Nobody reading it can tell at a glance, and the
audit cannot either.
`return run` settles it by structure. The first branch that matches ends the
function, so the second cannot read what the first wrote, whatever the numbers do
later. The dispatch is per-marker because tick calls us once per chamber, so ending
the function here ends this chamber's turn and no other's - the reason the audit
warns against `return` inside an `as` loop does not apply.

still

phantoms_keep:rite/heart/still

Did this player move at all this tick?
Within:

function phantoms_keep:rite/heart/watch, as a player near the chamber

Desc:

Two deltas against the previous tick's totals. walk_one_cm and sprint_one_cm are
separate statistics and both have to be watched, or a player could creep the whole
vigil out at a sprint. Crouching moves walk_one_cm, so it is covered.
The tag is cleared first and re-added only on a zero delta, so it describes THIS
tick and never leaks into the next.

stir

phantoms_keep:rite/heart/stir

The root notices you
Within:

function phantoms_keep:rite/heart/watch, as a root marker, at it

Desc:

Runs every tick from twelve onward, which is what makes the wait legible: the trunk
creaks harder the longer you hold it, so a player learns the rite is working before
the three seconds are up rather than guessing.

tick

phantoms_keep:rite/heart/tick

The heart chamber, per tick
Within:

tag/function minecraft:tick

Desc:

Costs nothing until somebody is actually down there: everything is gated on a player
within 24 of this chamber's own marker. EVERY chamber ticks itself - `as

E[...arena_heart]`,:

never limit=1 - because a keep has four arenas and limit=1 would
pick an arbitrary one (D63).
24 BLOCKS, NOT 128. The four arenas sit 30 to 100 blocks apart, far closer than the
480-block minimum between keeps, so the generous radius used upstairs would let one
chamber read another's roots.
THREE STATES ON riteon. 0 dormant, the moss is up and the roots are not. 1 the moss
has been cut and the vigil is available. 2 the rite is finished and the Warden has
been called.
REARM READS FIRST, AND THE PLAYER TEST IS WHAT MAKES THAT SAFE. rearm writes riteon 0,
which the moss line below tests for - a guard-then-reread on its face (D62). It cannot
misfire, and not by arithmetic: rearm requires NOBODY within 24 while both lines under it
require somebody within 24. The discriminator is an entity test that no branch writes, so
whenever rearm has run, the lines that read what it wrote are already excluded. Ordering it
first is still necessary the other way round, because watch can reach done, which latches
riteon to 2 - and a rearm sweep running afterwards would re-read that on the same tick.

wake

phantoms_keep:rite/heart/wake

This heart is awake
Within:

function phantoms_keep:rite/heart/watch, as a root marker, at it

Desc:

The trunk grows resin, which is the visible record that this root is done and the
reason the player can count their progress without a UI. Resin is what a creaking
heart produces in vanilla, so the material is not decoration - it is the right one.

watch

phantoms_keep:rite/heart/watch

One chamber's four roots
Within:

function phantoms_keep:rite/heart/tick, as the chamber marker, at it

Desc:

THE VIGIL. A root wakes when a player stands within three blocks of it and does not
move for sixty ticks. Movement of any kind resets that root to zero - not the whole
rite, only the root you were standing at, so a slip costs three seconds rather than
the walk back.
STILLNESS IS A DELTA ON THE VANILLA STATISTICS. walk_one_cm and sprint_one_cm are
already kept by this pack; if neither advanced this tick the player did not move. No
stored coordinates, no comparison against last tick's position, and it cannot be
fooled by standing on a moving block.

wound

phantoms_keep:rite/heart/wound

That was his
Within:

function phantoms_keep:rite/heart/broke, as the true root marker, at it

Desc:

HEALTH IS SET, NOT DAMAGED. He is Invulnerable while the roots stand, so `damage`
does nothing to him at all; writing Health directly is the only thing that moves him,
and it keeps the vanilla boss bar working with no extra machinery.
Every root regrows and a new true heart is chosen, so each wound restarts the hunt.
Three wounds and the third writes him to nothing.

wrong

phantoms_keep:rite/heart/wrong

That one was not his
Within:

function phantoms_keep:rite/heart/broke, as a root marker, at it

Desc:

The cost of guessing. Not damage - a slow and a blindness, because the punishment for
breaking the wrong heart should be that the thing hunting you gets a free approach
while you cannot see it, not that you lose health you could have potioned back.

arena

phantoms_keep:rite/hold/arena

Somebody lit the green set in the arena
Within:

function phantoms_keep:rite/hold/arena_tick, as the arena marker, at it

Desc:

The far end of the hold's pointer. He arrives HERE, in thirty blocks of room, with the
mandala under him - not in the eleven-block cell where the candles were read.
Reuses the altar's ritual machinery exactly as every other rite does, so the eighty
ticks of build-up come for free.

arena_tick

phantoms_keep:rite/hold/arena_tick

Watch the arena's green set
Within:

tag/function minecraft:tick

Desc:

Only ever true in an arena the hold has pointed at, because nothing else places a
green candle down there. Bounded to 24, the chamber radius, so one arena cannot read
another's (D63).

kindle

phantoms_keep:rite/hold/kindle

The soul fires take
Within:

function phantoms_keep:rite/hold/mark, as a campfire marker, at it

Desc:

FACING IS READ, NOT ASSUMED. `lit` is a block state, so lighting a campfire means a
setblock, and a setblock has to state the whole state - and the room rotates with the
jigsaw, so the south these two were built facing is not the south they will generate
facing. Four lines, each writing back the facing it just tested, so a line that fires
cannot make a later one true. Same shape as rite/cells/douse_one, same reason (D5).

mark

phantoms_keep:rite/hold/mark

The arena is named
Within:

function phantoms_keep:rite/hold/watch, as the hold marker, at it

Desc:

RANDOM, NOT NEAREST. Nearest is always the room next door; random means solving the
candles sends you somewhere you have to go and find, and the green set is the only lit
green thing in the undercroft, so the room announces itself once you are close.
THE ARENA IS RESOLVED ONCE AND TAGGED. `sort=random` re-rolls on every evaluation, so
four selectors would name four different arenas - the claim in one, the candle in
another, the sound in a third. The tag is taken, used, and dropped inside this
function so nothing outside it can ever see it.
THE CLAIM is what stops two rites sharing a chamber. A keep rolls about three arenas
from four options with replacement, so the one this names very often already has a
rite of its own. phantoms_keep_claimed switches that rite off, and the room is the
Mirage Master's for the rest of this keep's life. It lives on the ARENA's own marker,
never a fake player - four chambers per keep and they must not share (D63).
Latched on the first line, so eighty ticks of ritual cannot re-run any of it.

name

phantoms_keep:rite/hold/name

One arena is named, and it is guaranteed to belong to THIS keep
D11
Within:

function phantoms_keep:rite/hold/mark, at this keep's arena_upper marker

Desc:

EXECUTED AT THE KEEP CENTRE, NOT AT THE HOLD. Every selector below is measured from
phantoms_keep_arena_upper, which is baked at [20,24,20] of the 40x40 main_keep - dead
centre, exactly one per keep. That is what makes the bounds provable.
THE BOUND IS 110 AND THAT NUMBER IS NOT ARBITRARY. Own arenas reach 102, foreign ones
begin at 122, so anything in [102, 122) separates them; 110 sits in the middle with 8
blocks of margin below and 12 above. Distance alone could not have done this from the
Hold marker, where the two ranges overlap - moving the origin to the centre is what
creates the gap.
EVERY named selector is bounded, not just the first. Two keeps can run this in the
same tick, and phantoms_keep_named is a global tag; an unbounded `@e[tag=named,limit=1]`
would then be free to pick up the other keep's arena between the tag and its removal.
sort=random is deliberate and unchanged - see mark.mcfunction. Nearest is always the
room next door; random means solving the candles sends you somewhere to go and find.

tick

phantoms_keep:rite/hold/tick

The hold, per tick
Within:

tag/function minecraft:tick

Desc:

Bounded to 16 - the room is 11x8x9 and one generates per keep, on the vault landing.
Two states on holdon. 0 armed, 1 spent. The dispatch is a single conditional rather
than an if/unless pair, so there is nothing for a guard-then-reread to happen between
(D62): mark writes holdon 1 on its own first line and this test excludes it next tick.

watch

phantoms_keep:rite/hold/watch

Are all three green sets lit?
Within:

function phantoms_keep:rite/hold/tick, as the hold marker, at it

Desc:

THREE OF SEVENTEEN. The room carries seventeen candle blocks in three colours around
its walls; only the green ones count. Red and purple are not decoys in the puzzle
sense - nothing punishes lighting them - they are camouflage, so the answer is a thing
you notice rather than a thing you are told.
Counted off the markers, never off a block sweep, so it stays correct if anybody
rearranges the room later.

done

phantoms_keep:rite/proc/done

Every stone is lit
Within:

function phantoms_keep:rite/proc/watch, as the chamber marker, at it

Desc:

Reuses the altar's ritual machinery exactly as bell/solved and candle/solved do, so
the eighty ticks of build-up come for free. Latched to 2 on the first line, or those
eighty ticks would re-trigger the check every one of them.

douse

phantoms_keep:rite/proc/douse

Every stone goes out
Within:

function phantoms_keep:rite/proc/rearm, as the chamber marker, at it

Desc:

ONLY EVER CALLED BY REARM NOW. It used to be reachable from fail as well, which is
what made the sigil flicker: a rule broken mid-walk wiped everything the player had
lit. Nothing resets the sigil any more except the room emptying.

init

phantoms_keep:rite/proc/init

First look at this chamber
Within:

function phantoms_keep:rite/proc/watch, as the chamber marker, at it

Desc:

Runs once per chamber. Counts its own stones rather than assuming 56, so the rite is
correct whatever the mandala turns out to hold - and starts them all dark, because a
freshly generated arena ships every bulb lit and a sigil that begins lit has nothing
to show you.

light

phantoms_keep:rite/proc/light

This stone lights, and stays lit
Within:

function phantoms_keep:rite/proc/watch, as a ward marker, at it

Desc:

The score is the record, not the block. A player can break a bulb, a creeper could
take one - reading progress off the world would lose it. `lit` on the marker is what
counts, and the caller's `unless lit matches 1` is what makes this run exactly once
per stone however long you stand on it.

rearm

phantoms_keep:rite/proc/rearm

Nobody on the sigil
Within:

function phantoms_keep:rite/proc/tick, as the chamber marker, at it

Desc:

Repeatable, like everything else in this pack. A chamber left half-walked resets once
the room empties rather than staying part-lit for whoever comes next.

tick

phantoms_keep:rite/proc/tick

The procession chamber, per tick
Within:

tag/function minecraft:tick

Desc:

REARM READS FIRST, WATCH WRITES SECOND, and both test the same
`entity @a[distance=..24]` so they are a plain if/unless pair rather than two radii
that happen not to overlap. Safe by structure, not by arithmetic (D62).
24 blocks, never 128: four arenas per keep sit 30 to 100 apart, far closer than the
480 between keeps, so the radius used upstairs would let one chamber read another's
stones (D63).

watch

phantoms_keep:rite/proc/watch

Somebody is on the sigil
Within:

function phantoms_keep:rite/proc/tick, as the chamber marker, at it

Desc:

THERE ARE NO LONGER ANY RULES TO BREAK. The old rite failed you for stepping to a
wider ring, for one tick of sprint, or for 3.5 seconds between stones - three
invisible rules, any of which doused the whole sigil. With the rings one block apart
a player walking normally trips the first constantly, which is why the lights
flickered. All three are gone. You walk it, it lights, it stays lit.
THE TWO PROC LINES BOTH TEST `unless matches 2`, the same condition, and the one that
writes only ever writes 1 - which does not change whether the score is 2. So the
discriminator is untouched by either branch and this is a true if/else rather than a
guard-then-reread (D62).

cave_spider

phantoms_keep:spawn/cave_spider

One cave spider, in the keep
Within:

function phantoms_keep:spawn/dress

Desc:

Cave spiders get invisibility more often than their larger cousins and never a
rider - they are already small enough to lose in a corridor.

dress

phantoms_keep:spawn/dress

Dress anything that spawned in the keep since last second
Within:

function phantoms_keep:spawn/tick

Desc:

The tag is the whole guard: a mob is dressed once and never looked at again, so
the cost is one selector pass over undressed mobs, not over every mob alive.
predicate LAST in each selector - type and tag are cheap, the structure lookup
is not, so it only runs on the handful that got past the first two.

hp_24

phantoms_keep:spawn/hp_24

Raise this mob to 24 health
Within:

function phantoms_keep:spawn/skeleton

Desc:

Two lines, because raising max_health alone leaves the mob on its old value.

hp_30

phantoms_keep:spawn/hp_30

Raise this mob to 30 health
Within:

function phantoms_keep:spawn/skeleton

Desc:

Two lines, because raising max_health alone leaves the mob on its old value.

hp_34

phantoms_keep:spawn/hp_34

Raise this mob to 34 health
Within:

function phantoms_keep:spawn/skeleton

Desc:

Two lines, because raising max_health alone leaves the mob on its old value.

hp_40

phantoms_keep:spawn/hp_40

Raise this mob to 40 health
Within:

function phantoms_keep:spawn/skeleton

Desc:

Two lines, because raising max_health alone leaves the mob on its old value.

jockey

phantoms_keep:spawn/jockey

The rider on a spider
Within:

function phantoms_keep:spawn/spider

Desc:

Same kit as any keep skeleton but no armour weight - a jockey is a nuisance, not
a tank, and armour on something that fast stops being fun.

skeleton

phantoms_keep:spawn/skeleton

One skeleton, kitted out
Within:

function phantoms_keep:spawn/dress

Desc:

Weapon and armour come from loot tables so the odds live in JSON where they can be
tuned and validated, rather than in a ladder of `random value` branches. Each armour
slot rolls independently against a table that is 58/100 empty, so a fully armoured
skeleton is rare and reads as something worth backing away from.
Health is a five-step ladder rather than a rolled number because `attribute ... base
set` takes a literal, not a score. Health must be re-set after max_health or the mob
keeps its old value and stands there at 20/40.

spider

phantoms_keep:spawn/spider

One spider, in the keep
Within:

function phantoms_keep:spawn/dress

Desc:

Three outcomes: plain, invisible, or carrying a rider. The jockey is written
straight into Passengers rather than summoned and then mounted - one command,
atomic, and no window where a loose skeleton exists beside its spider.
The rider is pre-tagged as dressed so the next pass leaves it alone; it gets its
own kit here instead.

tick

phantoms_keep:spawn/tick

Spawn dressing clock
Within:

tag/function minecraft:tick

Desc:

One counter per tick, the real work once a second. Same shape as zone/tick:a newly spawned mob getting its gear a fraction of a second late is invisible,
and evaluating the in_keep structure predicate against every mob in the world
twenty times a second would not be.

zombie_villager

phantoms_keep:spawn/zombie_villager

One zombie villager, in the keep
Within:

function phantoms_keep:spawn/dress

Desc:

Carries a copper lantern, any oxidation stage. Held in the offhand so the main hand
stays free for its own attack animation, and the light reads as something it is
carrying rather than swinging.

tick

phantoms_keep:tick

Phantom Keep - per-tick atmosphere
Within:

tag/function minecraft:tick

Desc:

Applies the keep's gloom and fog to any player standing inside the structure.
Scoped by the phantoms_keep:in_keep predicate so it costs nothing anywhere else.
seed a keep's puzzle state the first time its arena marker is loaded.
One tagged-marker query per tick over a handful of markers, and it stops doing anything
at all once each is seeded.

enter

phantoms_keep:zone/enter

Entered the keep
Within:

function phantoms_keep:zone/zone_check

inside

phantoms_keep:zone/inside

A player is inside the keep
Within:

function phantoms_keep:zone/zone_check

Desc:

Runs as one player already known to be inside - the expensive test is spent, so
everything here is a score or gamemode check against @s.
same unset-is-not-zero trap as the music gate

leave

phantoms_keep:zone/leave

Left the keep
Within:

function phantoms_keep:zone/zone_check

music

phantoms_keep:zone/music

Music clock
Within:

tag/function minecraft:tick

Desc:

Two cheap commands per tick; the real work happens once every 200.

music_check

phantoms_keep:zone/music_check

Who should be hearing the keep, and who should not any more
Within:

function phantoms_keep:zone/music, every 200 ticks

Desc:

THIS ONLY EVER STARTED THE TRACK. A `record` sound runs to its own end wherever
the player goes, so walking out of the keep left the theme following you across
the overworld until the whole three minutes was up. The countdown score was only
ever a "is something already playing" guard - it never silenced anything.
Now leaving stops it. phantoms_keep_hearing marks a player the pack has started
the keep track for, which is what makes the stop possible at all: without it there
is no way to tell "left the keep, was listening to us" from "left the keep, was
never listening", and a blanket stopsound would cut the music of every player in
the world every ten seconds.
Stopped by name, so a jukebox or a note block the player has going is untouched.
Nothing is done here for players on a fight track - boss/fight_music owns those,
and phantoms_keep_battle keeps the two systems from arguing over the same ears.

music_leave

phantoms_keep:zone/music_leave

This player has walked out of the keep - take the theme with them
Within:

function phantoms_keep:zone/music_check, as the departing player

music_start

phantoms_keep:zone/music_start

Start one approach track
Within:

function phantoms_keep:zone/music

Desc:

3600 ticks is three minutes - a little under the shortest track, so a new one
begins just before the last ends rather than leaving silence.

tick

phantoms_keep:zone/tick

Zone clock
Within:

tag/function minecraft:tick

Desc:

This evaluated the in_keep STRUCTURE PREDICATE SIX TIMES PER TICK, each against
every player - 120 structure-manager lookups per player per second, to decide
something that only changes when someone walks through a wall.
Now: one cheap counter per tick, and the whole block once every 20 (one second).
A second of latency on the adventure-mode swap is invisible; a second of latency
on a whisper is the point.

whisper

phantoms_keep:zone/whisper

One overheard fragment
Within:

function phantoms_keep:zone/inside, as one player inside the keep

Desc:

TWENTY-SIX FRAGMENTS, AND HALF OF THEM ARE NOW CLUES. The first twelve are the
original atmosphere and they stay - the keep should feel like it is muttering. The
rest each point at one boss, because twelve bosses had summoning conditions a player
could only find by accident, and a dungeon that never tells you how to start is not
mysterious, it is opaque.
PHRASED AS OVERHEARD, NEVER AS INSTRUCTION. "Five bells, and he would not count the
towers" tells you what to do without a tutorial telling you to do it, and still reads
as the building talking to itself.

zone_check

phantoms_keep:zone/zone_check

Once a second - who is inside?
Within:

function phantoms_keep:zone/tick

Desc:

The predicate is still evaluated more than once here, but 20x less often. Ordered
so the cheap score and gamemode filters come first and cut the candidate set
before the structure lookup runs.

Automatically generated by MCFDoc on 2026-08-28