init: switch hands api

This commit is contained in:
onebeastchris 2024-07-04 01:37:52 +02:00
parent ff1e1dd7e3
commit 18e329c69b
2 changed files with 10 additions and 0 deletions

View file

@ -81,4 +81,9 @@ public interface EntityData {
* @return whether the movement is locked
*/
boolean isMovementLocked();
/**
* Allows switching the current items in the main and offhand.
*/
void switchHands();
}

View file

@ -96,4 +96,9 @@ public class GeyserEntityData implements EntityData {
public boolean isMovementLocked() {
return !movementLockOwners.isEmpty();
}
@Override
public void switchHands() {
session.requestOffhandSwap();
}
}