Skip to content

Rotation Argument

Must be a rotation consisting of yaw and pitch, which returns a Location only containing yaw and pitch. Example:

Java
new StellarCommand("set-rotation")
    .addRotationArgument("rotation")
    .addExecution<Player>(Player.class, context -> {
        Location rotation = context.getArgument<Location>("rotation");
        Location newLocation = context.getSender().getLocation().clone();
        newLocation.setYaw(rotation.getYaw());
        newLocation.setPitch(rotation.getPitch());
        context.getSender().teleport(newLocation);
    });

Rotation Argument

Released under the MIT License.