LookupResult

interface LookupResult(source)

Result of a lenient ID lookup, like Levels.lookupTrack.

If you only need an ID that works right now, take foundId:

String configuredTrack = config.getString("track", ""); // "Woodcutting"
Key trackId = levels.lookupTrack(configuredTrack).getFoundId(); // mcmmo:woodcutting
if (trackId == null) return;

To tell a server owner what is wrong with their config, check the status.

The result is a snapshot. Plugins may load their content after the server start and change it on reload, so the same value may give another result later. Don't look up IDs in onLoad.

Since

0.12.0

Properties

Link copied to clipboard
open val foundId: Key?

The ID if the status is LookupStatus.FOUND, otherwise null.

Link copied to clipboard
abstract val ids: List<Key>

Existing IDs matching the value: one for LookupStatus.FOUND, several for LookupStatus.AMBIGUOUS, otherwise empty.

Link copied to clipboard
abstract val status: LookupStatus

What the lookup ended with.