Lingering Potion
Registry name
etfuturum.lingeringPotion
Basic info
- Health: Not applicable (projectile)
- Armor: None
- Size: Inherited from
EntityPotion(splash potion base) - Spawn conditions: Thrown by player using a lingering potion item
- Drops: None (dissipates on impact)
- Behaviour: Throwable potion that creates a lingering area-of-effect cloud on impact. Cloud applies the potion effect to all entities within range.
Impact mechanics
On onImpact(MovingObjectPosition):
- Spawns
EntityLingeringEffectat the impact point - Plays splash sound (2002 aux magic number)
- Marks entity as dead
Potion data
- Stores
ItemStackof the potion item (with damage value encoding the potion type) - Full NBT persistence: writes
"Potion"compound to NBT - If stack is null on load → entity dies immediately
IEntityAdditionalSpawnData
writeSpawnData/readSpawnData: serialises the ItemStack usingByteBufUtils.writeItemStack/readItemStack- Used for multiplayer sync
Relationship to splash potion
- Extends
EntityPotion(splash potion entity) - Splash potion impacts immediately; lingering creates the effect cloud
- The cloud entity (
EntityLingeringEffect) is responsible for the actual AoE application
Notes
EntityPotionbase handles the thrown potion physics and rendering- This entity only overrides the impact behavior to spawn the lingering effect cloud
worldObj.isRemoteguard ononImpactensures effect only spawns server-side