Shared Effects¶
Quick Start: Spice it up with twists.
Several modifiers sharing one player's potion effects through the ledger. The one-line forms live in the cheatsheet. Twins: every <pfx.*> tag also ships <rfx.*> and <gfx.*>; see Role and global twins.
| Tag | Meaning |
|---|---|
<pfx.set:player,id?,effects,hide?> |
Write one entry (auto id when omitted). |
<pfx.get:player,id> |
Read one id, [] when unset. |
<pfx.clear:player,id?> |
Drop one id (all entries when the id is omitted), empty. |
<pfx.duration:player,id,effect> |
Live seconds left, -1 runs forever, null when absent. |
<rfx.set:role,id,effects,hide?> |
Write one id for every member of the role, empty. |
<rfx.get:role,id> |
Read one id per member, roster order. |
<rfx.clear:role,id?> |
Drop one id per member (all when omitted), empty. |
<rfx.duration:role,id,effect> |
Live seconds left per member, roster order. |
<gfx.set:id,effects,hide?> |
Write one id for every hunter and speedrunner, empty. |
<gfx.get:id> |
Read one id per participant, roster order. |
<gfx.clear:id?> |
Drop one id per participant (all when omitted), empty. |
<gfx.duration:id,effect> |
Live seconds left per participant, roster order. |
Several modifiers may all want to change one player's potion
effects. Instead of each firing blind writes, every modifier owns
one named entry in a shared ledger and the engine merges them (the
modifier's own id, via <id>, is a good entry id):
<pfx.set:Steve,glow,[[glowing,0,5]]> writes exactly those doses
for that id, replacing the old entry. The id may be omitted: a
list in second position auto-assigns <modifier>-N with the
smallest free N and yields the assigned id, so capture it in a
flag. <pfx.get:Steve,glow> reads one id back ([] when unset).
<pfx.clear:Steve,glow> drops one id, and <pfx.clear:Steve> with
no id drops every entry the player has. Named writes leave nothing
behind.
Each successful set or clear immediately refreshes the player's merged view, and a 5-tick engine beat re-picks winners. Per effect, the higher amplifier always wins, then the longer remaining (infinite beats finite), so one mod can hold infinite blindness while another flashes a burst and clears it without disturbing the infinite hold. A finite winner at 6 ticks or less hands over early to a longer-remaining runner-up, whatever its amplifier, so expiry never blips. Doses tick down naturally between writes; expired entries stay stored until cleared by hand (durations read 0). When a player quits or their match tears down, their whole ledger clears automatically and managed effects leave with them.
Never edit ledger-managed effects directly (with effect commands
or another plugin): the next ledger refresh detects a foreign
stronger effect, warns once per player per match about a Dirty
Effect Hack, and re-applies the merged winners. Missing effects
stay silent (milk and rival clears are legitimate; the next
mutation re-applies). See
Dirty Effect Hack for details.
The old <peffect>, <geffect>, and <reffect> writers were
removed in favor of this ledger. Role and global twins take the
same doses; reads yield one value per roster member in roster
order.