Modules
Staff API
Freeze, unfreeze, vanish and staff mode from code with the same permissions and hierarchy as the commands.
StaffService staff = api.service(StaffService.class).orElseThrow(IllegalStateException::new);
staff.freeze().toggleAsync(actor, "Steve").whenComplete((result, error) -> {
// result: FROZEN, ALREADY_FROZEN, UNFROZEN or NOT_FROZEN
});Freeze errors
Failures arrive as IllegalArgumentException with a code: no-permission, hierarchy, self, player-offline, user-not-found, ranks-unavailable, loading.
| FreezeService.Result | Meaning |
|---|---|
| FROZEN | The player is now frozen. |
| ALREADY_FROZEN | The player was already frozen. |
| UNFROZEN | The player is no longer frozen. |
| NOT_FROZEN | The player was not frozen. |
Vanish and staff mode
boolean hidden = staff.vanish().vanished(uuid); // memory, server thread
boolean visible = staff.vanish().canSee(viewer, target);
boolean inMode = staff.mode().active(uuid); // any threadStaffModeService.enter and exit run on the server thread with the same checks as /staffmode.