跳到正文
烈焰甘蔗Wiki

Lingering Potion

Registry name

etfuturum:lingering_potion

Audit correction: previously written as etfuturum.lingeringPotion. Evidence: core/proxy/CommonProxy.java:241 registerEntity(EntityLingeringPotion.class, "lingering_potion", 6, ...)

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):

  1. Spawns EntityLingeringEffect at the impact point
  2. Plays splash sound (2002 aux magic number)
  3. Marks entity as dead

Potion data

  • Stores ItemStack of 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 using ByteBufUtils.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

  • EntityPotion base handles the thrown potion physics and rendering
  • This entity only overrides the impact behavior to spawn the lingering effect cloud
  • worldObj.isRemote guard on onImpact ensures effect only spawns server-side

Configuration gate

  • Entity registration (lingering_potion and the companion lingering_effect, id 7): ConfigBlocksItems.enableLingeringPotions, default ON (configuration/configs/ConfigBlocksItems.java). lingering_effect has no wiki entry — it is a registered entity that is currently uncovered.
浏览全部模组