Add "/player look at" subcommand
This commit is contained in:
1 parent
41258e8494
commit
1f1c5de303
2 files changed
+17
No files matched your search
@@ -2,6 +2,7 @@ package carpet.helpers;
|
||||
|
||||
import carpet.fakes.ServerPlayerEntityInterface;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.command.arguments.EntityAnchorArgumentType;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.passive.HorseBaseEntity;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
@@ -127,6 +128,12 @@ public class EntityPlayerActionPack
|
||||
return this;
|
||||
}
|
||||
|
||||
public EntityPlayerActionPack lookAt(Vec3d position)
|
||||
{
|
||||
player.lookAt(EntityAnchorArgumentType.EntityAnchor.EYES, position);
|
||||
return this;
|
||||
}
|
||||
|
||||
public EntityPlayerActionPack turn(float yaw, float pitch)
|
||||
{
|
||||
return look(player.yaw + yaw, player.pitch + pitch);
|
||||
|
||||
Reference in new issue
Block a user