Class ProjectileUtil
java.lang.Object
net.minecraft.world.entity.projectile.ProjectileUtil
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic floatcomputeMargin(Entity entity) static @Nullable EntityHitResultgetEntityHitResult(Entity source, Vec3 startVec, Vec3 endVec, AABB boundingBox, Predicate<Entity> filter, double distance) Gets the EntityHitResult representing the entity hitstatic @Nullable EntityHitResultgetEntityHitResult(Level level, Entity source, Vec3 startVec, Vec3 endVec, AABB boundingBox, Predicate<Entity> filter, float margin) Gets the EntityHitResult representing the entity hitstatic @Nullable EntityHitResultgetEntityHitResult(Level level, Projectile source, Vec3 startVec, Vec3 endVec, AABB boundingBox, Predicate<Entity> filter) static com.mojang.datafixers.util.Either<BlockHitResult, Collection<EntityHitResult>> getHitEntitiesAlong(Entity entity, AttackRange attackRange, Predicate<Entity> predicate, ClipContext.Block clipContext) private static com.mojang.datafixers.util.Either<BlockHitResult, Collection<EntityHitResult>> getHitEntitiesAlong(Entity entity, Vec3 pos, Vec3 start, Predicate<Entity> predicate, Vec3 end, float hitboxMargin, ClipContext.Block clipContext) private static HitResultgetHitResult(Vec3 pos, Entity source, Predicate<Entity> filter, Vec3 deltaMovement, Level level, float margin, ClipContext.Block clipContext) static HitResultgetHitResultOnMoveVector(Entity projectile, Predicate<Entity> filter) static HitResultgetHitResultOnMoveVector(Entity projectile, Predicate<Entity> filter, ClipContext.Block clipContext) static HitResultgetHitResultOnViewVector(Entity source, Predicate<Entity> filter, double scale) static Collection<EntityHitResult> getManyEntityHitResult(Level level, Entity entity, Vec3 start, Vec3 end, AABB box, Predicate<Entity> predicate, boolean hitIfInside) static Collection<EntityHitResult> getManyEntityHitResult(Level level, Entity entity, Vec3 start, Vec3 end, AABB box, Predicate<Entity> predicate, float margin, ClipContext.Block clipContext, boolean hitIfInside) static AbstractArrowgetMobArrow(LivingEntity owner, ItemStack pickupItemStack, float velocity, @Nullable ItemStack weapon) static InteractionHandgetWeaponHoldingHand(LivingEntity livingEntity, Predicate<Item> itemPredicate) static InteractionHandgetWeaponHoldingHand(LivingEntity shooter, Item weapon) Deprecated.static voidrotateTowardsMovement(Entity projectile, float rotationSpeed)
-
Field Details
-
DEFAULT_ENTITY_HIT_RESULT_MARGIN
public static final float DEFAULT_ENTITY_HIT_RESULT_MARGIN- See Also:
-
-
Constructor Details
-
ProjectileUtil
public ProjectileUtil()
-
-
Method Details
-
getHitResultOnMoveVector
-
getHitEntitiesAlong
public static com.mojang.datafixers.util.Either<BlockHitResult,Collection<EntityHitResult>> getHitEntitiesAlong(Entity entity, AttackRange attackRange, Predicate<Entity> predicate, ClipContext.Block clipContext) -
getHitResultOnMoveVector
public static HitResult getHitResultOnMoveVector(Entity projectile, Predicate<Entity> filter, ClipContext.Block clipContext) -
getHitResultOnViewVector
-
getHitResult
-
getHitEntitiesAlong
private static com.mojang.datafixers.util.Either<BlockHitResult,Collection<EntityHitResult>> getHitEntitiesAlong(Entity entity, Vec3 pos, Vec3 start, Predicate<Entity> predicate, Vec3 end, float hitboxMargin, ClipContext.Block clipContext) -
getEntityHitResult
public static @Nullable EntityHitResult getEntityHitResult(Entity source, Vec3 startVec, Vec3 endVec, AABB boundingBox, Predicate<Entity> filter, double distance) Gets the EntityHitResult representing the entity hit -
getEntityHitResult
public static @Nullable EntityHitResult getEntityHitResult(Level level, Projectile source, Vec3 startVec, Vec3 endVec, AABB boundingBox, Predicate<Entity> filter) -
computeMargin
-
getEntityHitResult
public static @Nullable EntityHitResult getEntityHitResult(Level level, Entity source, Vec3 startVec, Vec3 endVec, AABB boundingBox, Predicate<Entity> filter, float margin) Gets the EntityHitResult representing the entity hit -
getManyEntityHitResult
public static Collection<EntityHitResult> getManyEntityHitResult(Level level, Entity entity, Vec3 start, Vec3 end, AABB box, Predicate<Entity> predicate, boolean hitIfInside) -
getManyEntityHitResult
public static Collection<EntityHitResult> getManyEntityHitResult(Level level, Entity entity, Vec3 start, Vec3 end, AABB box, Predicate<Entity> predicate, float margin, ClipContext.Block clipContext, boolean hitIfInside) -
rotateTowardsMovement
-
getWeaponHoldingHand
Deprecated. -
getWeaponHoldingHand
public static InteractionHand getWeaponHoldingHand(LivingEntity livingEntity, Predicate<Item> itemPredicate) -
getMobArrow
public static AbstractArrow getMobArrow(LivingEntity owner, ItemStack pickupItemStack, float velocity, @Nullable ItemStack weapon)
-