DUXPLIMA Documentation

API

Depending on uxmBedrock, the BedrockApi service and its events.

The API is in the uxmBedrock jar, package com.uxplima.bedrock.api. Add the jar as a compileOnly dependency and uxmBedrock to your plugin's dependencies, so it loads first.

BedrockApi.get().ifPresent(api -> {
    if (api.isBedrock(player.getUniqueId())) {
        api.client(player.getUniqueId()).ifPresent(client -> {
            boolean touch = client.touch();
        });
    }
});

BedrockApi

MethodAnswers
static Optional<BedrockApi> get()The API from the services manager, while uxmBedrock runs
boolean isBedrock(UUID)Whether the player is online on Bedrock
Optional<BedrockClient> client(UUID)The player's client: device, input, pocket layout, Bedrock version
boolean menusAsForms(UUID)Whether the player chose forms for other plugins' menus
boolean wants(UUID, String feature)Whether a feature is on for the player: the server has it on and the player did not switch it off
boolean sendForm(UUID, Form)Sends a Floodgate (Cumulus) form; false for a Java player
Path packFolder()The folder the build is written to

Every method may be called from any thread.

BedrockClient

FieldType
playerUUID
nameString
deviceANDROID, IOS, MACOS, FIRE_OS, WINDOWS, PLAYSTATION, SWITCH, XBOX, VR, OTHER, UNKNOWN
inputKEYBOARD_MOUSE, TOUCH, CONTROLLER, VR, UNKNOWN
pocketLayoutboolean
versionString, empty when unknown

Events

Both are called off the server threads.

EventWhenGives
BedrockPackBuiltEventA build finishedfolder(), failure(), unknownItems(), unchanged()
BedrockChoiceEventA Bedrock player changed their choicesplayer(); ask the API for the new state

Plugins built on uxmLib reach the same answers through uxmLib's Bedrock and menu modules and need no dependency on uxmBedrock.