Skip to content

Modules

Staff API

Freeze, unfreeze, vanish and staff mode from code with the same permissions and hierarchy as the commands.

Java
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.ResultMeaning
FROZENThe player is now frozen.
ALREADY_FROZENThe player was already frozen.
UNFROZENThe player is no longer frozen.
NOT_FROZENThe player was not frozen.

Vanish and staff mode

Java
boolean hidden = staff.vanish().vanished(uuid);          // memory, server thread
boolean visible = staff.vanish().canSee(viewer, target);
boolean inMode = staff.mode().active(uuid);              // any thread

StaffModeService.enter and exit run on the server thread with the same checks as /staffmode.