Skip to content

Improved Entities

MehVahdJukaar edited this page Jul 25, 2026 · 1 revision

Improved Entities

Better base classes for projectiles and falling blocks, plus a couple of entity helpers.

ImprovedProjectileEntity

Vanilla splits projectile logic between AbstractArrow and ThrowableItemProjectile, and each of them handles a different set of edge cases badly. This combines both and fixes the usual complaints:

  • onHit and onHitBlock are called after the position is set, not before, so your hit effects land where the projectile actually is.
  • Swept AABB collision instead of a ray, which is much more accurate against blocks.
  • Portals and end portals both work, where arrows and snowballs each handle only one.
  • Streamlined gravity and deceleration, with spawnTrailParticles and hasReachedEndOfLife to override.

Extend it instead of ThrowableItemProjectile and you get all of that.

ImprovedFallingBlockEntity

A falling block that can carry a block entity and render an arbitrary block, with FallingBlockRendererGeneric on the client. Vanilla's falls back to a plain block model and drops its block entity.

Helpers

ParticleTrailEmitter spaces particles evenly along an entity's path instead of one per tick, so a fast projectile doesn't leave gaps:

private final ParticleTrailEmitter trail = ParticleTrailEmitter.builder()
        .spacing(0.2)
        .maxParticlesPerTick(4)
        .build();

// in tick()
trail.tick(this, ParticleTypes.FLAME);

IExtraClientSpawnData is Forge's IEntityAdditionalSpawnData on both loaders: implement writeSpawnData / readSpawnData to send extra data with the spawn packet.

IControllableVehicle for entities the player steers.

Clone this wiki locally