Expand description
Vanilla Projectile class hierarchy, mirrored as Rust traits + base structs.
Mirrors net.minecraft.world.entity.projectile:
Entity โ Projectile โ ThrowableProjectile โ ThrowableItemProjectile.
Concrete projectiles embed ProjectileBase (owner / left-owner / shot state)
and implement the trait stack; the per-layer tick logic chains explicitly via
Projectile::projectile_base_tick and
ThrowableProjectile::throwable_projectile_tick (vanilla super.tick()).
The block + entity move-vector raycast mirrors ProjectileUtil.
Modulesยง
- throwable ๐
- Vanilla
ThrowableProjectileโ the gravity/drag movement loop. - throwable_
item ๐ - Vanilla
ThrowableItemProjectileโ carries a synced rendered item stack.
Structsยง
- Entity
HitResult - A projectile-versus-entity raycast hit (vanilla
EntityHitResult). - Projectile
Base - Runtime fields shared by vanilla projectiles (vanilla
Projectilefields). - Projectile
State ๐
Enumsยง
- Projectile
Deflection - Vanilla projectile deflection behaviors (
ProjectileDeflection). - Projectile
Hit - Result of a projectile move-vector raycast (vanilla
HitResult).
Constantsยง
- MAX_
ENTITY_ ๐HIT_ MARGIN - Vanilla
ProjectileUtil.DEFAULT_ENTITY_HIT_RESULT_MARGIN. - SHOOT_
INACCURACY_ ๐SCALE - Vanilla
Projectile.shootper-axis spread scale (0.0172275 * uncertainty).
Traitsยง
- Projectile
- Vanilla-shaped behavior shared by entities that extend
Projectile. - Projectile
Event Source - Object-safe access to a projectile trait object from default
Projectilemethods. - Throwable
Item Projectile - Vanilla-shaped behavior shared by entities that extend
ThrowableItemProjectile. - Throwable
Projectile - Vanilla-shaped behavior shared by entities that extend
ThrowableProjectile.
Functionsยง
- axis_
component ๐ - clip_
segment ๐ - Clips the segment
from -> toagainstaabb, returning the entry point. - compute_
margin - Vanilla
ProjectileUtil.computeMargin: ramps the entity hit margin from 0 to 0.3 over the first ticks of flight. - get_
entity_ ๐hit_ result - Vanilla
ProjectileUtil.getEntityHitResult(entity-margin overload): returns the nearest entity whose inflated box the segmentfrom -> toenters. - lerp_
rotation ๐ - Vanilla
Mth.lerp(0.2, rotO, rot)after wrapping the old angle into range. - triangle_
random ๐ - Mirrors vanilla
RandomSource.triangle(mode, deviation).