-
Notifications
You must be signed in to change notification settings - Fork 56
Improved Entities
Better base classes for projectiles and falling blocks, plus a couple of entity helpers.
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:
-
onHitandonHitBlockare 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
spawnTrailParticlesandhasReachedEndOfLifeto override.
Extend it instead of ThrowableItemProjectile and you get all of that.
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.
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.
Basics Platform Helpers Registration Networking Events Configs Config Screen
Resources Runtime Resource Packs Texture Manipulation Resource Helpers Block Set API
Client Custom Models Item Rendering Rendered Textures Post Shaders GUI Toolkit Colors
World Block and Item Interfaces Additional Item Placements Improved Entities Fake Levels World Data Dispenser Behaviors
Utilities Codec Utilities Misc Helpers Commands
Datapacks Villagers Soft Fluids Map Markers Spawn Boxes Global Datapack Folder