added the handSitting toggle that enables sitting using the hand

This commit is contained in:
Oth3r 2024-06-22 19:18:36 -05:00
commit c2e708ba38
3 changed files with 14 additions and 0 deletions

View file

@ -211,6 +211,7 @@ public class Events {
Sit.server = s;
Sit.commandManager = s.getCommandManager();
UseBlockCallback.EVENT.register((pl, world, hand, hitResult) -> {
if (!Config.handSitting) return ActionResult.PASS;
ServerPlayerEntity player = Sit.server.getPlayerManager().getPlayer(pl.getUuid());
if (player == null) return ActionResult.PASS;
if (hand == net.minecraft.util.Hand.MAIN_HAND && hitResult.getType() == HitResult.Type.BLOCK) {