Class ProjectileUtil
java.lang.Object
net.minecraft.world.entity.projectile.ProjectileUtil
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic floatcomputeMargin(Entity source) static @Nullable EntityHitResultgetEntityHitResult(Entity except, Vec3 from, Vec3 to, AABB box, Predicate<Entity> matching, double maxValue) Gets theEntityHitResultrepresenting the entity hitstatic @Nullable EntityHitResultgetEntityHitResult(Level level, Entity source, Vec3 from, Vec3 to, AABB targetSearchArea, Predicate<Entity> matching, float entityMargin) Gets the EntityHitResult representing the entity hitstatic @Nullable EntityHitResultgetEntityHitResult(Level level, Projectile source, Vec3 from, Vec3 to, AABB targetSearchArea, Predicate<Entity> matching) static com.mojang.datafixers.util.Either<BlockHitResult, Collection<EntityHitResult>> getHitEntitiesAlong(Entity attacker, AttackRange attackRange, Predicate<Entity> matching, ClipContext.Block blockClipType) private static com.mojang.datafixers.util.Either<BlockHitResult, Collection<EntityHitResult>> getHitEntitiesAlong(Entity source, Vec3 origin, Vec3 from, Predicate<Entity> matching, Vec3 to, float entityMargin, ClipContext.Block clipType) private static HitResultgetHitResult(Vec3 from, Entity source, Predicate<Entity> matching, Vec3 delta, Level level, float entityMargin, ClipContext.Block clipType) static HitResultgetHitResultOnMoveVector(Entity source, Predicate<Entity> matching) static HitResultgetHitResultOnMoveVector(Entity source, Predicate<Entity> matching, ClipContext.Block clipType) static HitResultgetHitResultOnViewVector(Entity source, Predicate<Entity> matching, double distance) static Collection<EntityHitResult> getManyEntityHitResult(Level level, Entity source, Vec3 from, Vec3 to, AABB targetSearchArea, Predicate<Entity> matching, boolean includeFromEntity) static Collection<EntityHitResult> getManyEntityHitResult(Level level, Entity source, Vec3 from, Vec3 to, AABB targetSearchArea, Predicate<Entity> matching, float entityMargin, ClipContext.Block clipType, boolean includeFromEntity) static AbstractArrowgetMobArrow(LivingEntity mob, ItemStack projectile, float power, @Nullable ItemStack firedFromWeapon) static InteractionHandgetWeaponHoldingHand(LivingEntity livingEntity, Predicate<Item> itemPredicate) static InteractionHandgetWeaponHoldingHand(LivingEntity mob, Item weaponItem) 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 attacker, AttackRange attackRange, Predicate<Entity> matching, ClipContext.Block blockClipType) -
getHitResultOnMoveVector
public static HitResult getHitResultOnMoveVector(Entity source, Predicate<Entity> matching, ClipContext.Block clipType) -
getHitResultOnViewVector
-
getHitResult
-
getHitEntitiesAlong
private static com.mojang.datafixers.util.Either<BlockHitResult, Collection<EntityHitResult>> getHitEntitiesAlong(Entity source, Vec3 origin, Vec3 from, Predicate<Entity> matching, Vec3 to, float entityMargin, ClipContext.Block clipType) -
getEntityHitResult
public static @Nullable EntityHitResult getEntityHitResult(Entity except, Vec3 from, Vec3 to, AABB box, Predicate<Entity> matching, double maxValue) Gets theEntityHitResultrepresenting the entity hit -
getEntityHitResult
public static @Nullable EntityHitResult getEntityHitResult(Level level, Projectile source, Vec3 from, Vec3 to, AABB targetSearchArea, Predicate<Entity> matching) -
computeMargin
-
getEntityHitResult
-
getManyEntityHitResult
public static Collection<EntityHitResult> getManyEntityHitResult(Level level, Entity source, Vec3 from, Vec3 to, AABB targetSearchArea, Predicate<Entity> matching, boolean includeFromEntity) -
getManyEntityHitResult
public static Collection<EntityHitResult> getManyEntityHitResult(Level level, Entity source, Vec3 from, Vec3 to, AABB targetSearchArea, Predicate<Entity> matching, float entityMargin, ClipContext.Block clipType, boolean includeFromEntity) -
rotateTowardsMovement
-
getWeaponHoldingHand
Deprecated. -
getWeaponHoldingHand
public static InteractionHand getWeaponHoldingHand(LivingEntity livingEntity, Predicate<Item> itemPredicate) -
getMobArrow
public static AbstractArrow getMobArrow(LivingEntity mob, ItemStack projectile, float power, @Nullable ItemStack firedFromWeapon)
-