Skip to content

multishot on regular bows causes all arrows to go in one direction #403

@fayer3

Description

@fayer3

when enchanting a regular bow with multishot (not possible in vanilla, only possible with commands) all additional arrows are bundled with the main arrow

this is caused, because we override the yRot in Projectile#shootFromRotation here

@ModifyVariable(method = "shootFromRotation", at = @At("HEAD"), ordinal = 1, argsOnly = true)
private float vivecraft$modifyYRot(float yRot, @Share("dir") LocalRef<Vec3> direction) {
if (direction.get() != null) {
return (float) Math.toDegrees(Math.atan2(-direction.get().x, direction.get().z));
} else {
return yRot;
}
}

vanilla adds the offset to the yRot before calling this method, which causes it to break
in BowItem#shootProjectile

projectile.shootFromRotation(shooter, shooter.getXRot(), shooter.getYRot() + angle, ...

so we would need to change the direction in another way for this to work.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions