Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/BG-Software-LLC/SuperiorSkyblock2/llms.txt

Use this file to discover all available pages before exploring further.

The KeysManager provides methods to create and manage keys that represent entities, blocks, materials, and items in a consistent way across the plugin.

Entity Keys

getKey (EntityType)

Get the key of an entity type.
Key getKey(EntityType entityType)
entityType
EntityType
The entity type to check.
return
Key
The key representing the entity type.
Example:
KeysManager manager = plugin.getKeysManager();
Key zombieKey = manager.getKey(EntityType.ZOMBIE);

getEntityTypeKey

Get the key of an entity type by name.
Key getEntityTypeKey(String entityTypeName)
entityTypeName
String
The name of the entity type to create key for.
return
Key
The key representing the entity type.
Example:
Key zombieKey = manager.getEntityTypeKey("ZOMBIE");

getKey (Entity)

Get the key of an entity.
Key getKey(Entity entity)
entity
Entity
The entity to check.
return
Key
The key representing the entity.
Example:
Key entityKey = manager.getKey(spawnedEntity);

Block Keys

getKey (Block)

Get the key of a block.
Key getKey(Block block)
block
Block
The block to check.
return
Key
The key representing the block.
Example:
Block block = player.getTargetBlock(null, 5);
Key blockKey = manager.getKey(block);

getKey (BlockState)

Get the key of a block-state.
Key getKey(BlockState blockState)
blockState
BlockState
The block-state to check.
return
Key
The key representing the block state.

Item Keys

getKey (ItemStack)

Get the key of an item-stack.
Key getKey(ItemStack itemStack)
itemStack
ItemStack
The item-stack to check.
return
Key
The key representing the item stack.
Example:
ItemStack item = player.getInventory().getItemInMainHand();
Key itemKey = manager.getKey(item);

Material Keys

getKey (Material with data)

Get the key of a material and data.
Key getKey(Material material, short data)
material
Material
The material to check.
data
short
The data to check.
return
Key
The key representing the material with data.
Example:
Key woolKey = manager.getKey(Material.WOOL, (short) 14);

getKey (Material)

Get the key of a material.
Key getKey(Material material)
material
Material
The material to create key for.
return
Key
The key representing the material.
Example:
Key diamondKey = manager.getKey(Material.DIAMOND);

getMaterialAndDataKey

Get the key of a material and data, split by ’:’ (optionally).
Key getMaterialAndDataKey(String type)
type
String
The combined material-data pair to create key for.
return
Key
The key representing the material and data.
Example:
Key woolKey = manager.getMaterialAndDataKey("WOOL:14");
Key stoneKey = manager.getMaterialAndDataKey("STONE");

Spawner Keys

getSpawnerKey (EntityType)

Get the key of a spawner block with specific entity type.
Key getSpawnerKey(EntityType entityType)
entityType
EntityType
The entity type of the spawner to create key for.
return
Key
The key representing the spawner.
Example:
Key zombieSpawner = manager.getSpawnerKey(EntityType.ZOMBIE);

getSpawnerKey (String)

Get the key of a spawner block with specific entity type by name.
Key getSpawnerKey(String entityTypeName)
entityTypeName
String
The name of the entity type of the spawner to create key for.
return
Key
The key representing the spawner.
Example:
Key zombieSpawner = manager.getSpawnerKey("ZOMBIE");

String Keys

getKey (String)

Get the key of a string.
Key getKey(String key)
key
String
The string to check.
return
Key
The key representing the string.
Example:
Key customKey = manager.getKey("CUSTOM_KEY");

getKey (global and sub key)

Get the key of a global-key and a sub-key.
Key getKey(String globalKey, String subKey)
globalKey
String
The global key.
subKey
String
The sub key.
return
Key
The key representing the combined keys.
Example:
Key spawnerKey = manager.getKey("SPAWNER", "ZOMBIE");

Key Collections

createKeySet (empty)

Create a new empty KeySet instance.
KeySet createKeySet(Supplier<Set<String>> setCreator)
setCreator
Supplier<Set<String>>
The supplier to create the underlying set.
return
KeySet
A new empty KeySet instance.
Example:
KeySet keySet = manager.createKeySet(HashSet::new);
keySet.add(manager.getKey(Material.DIAMOND));
keySet.add(manager.getKey(Material.EMERALD));

createKeySet (from collection)

Create a new KeySet instance from the given collection.
KeySet createKeySet(Supplier<Set<String>> setCreator, Collection<Key> collection)
setCreator
Supplier<Set<String>>
The supplier to create the underlying set.
collection
Collection<Key>
The collection to create KeySet from.
return
KeySet
A new KeySet instance containing the collection elements.
If the provided collection is also a KeySet, the exact same instance of that set is returned. Otherwise, the returned KeySet is a copy of that collection.
Example:
List<Key> keys = Arrays.asList(
    manager.getKey(Material.DIAMOND),
    manager.getKey(Material.EMERALD)
);
KeySet keySet = manager.createKeySet(HashSet::new, keys);

Key Maps

createKeyMap (empty)

Create a new empty KeyMap instance.
<V> KeyMap<V> createKeyMap(Supplier<Map<String, V>> mapCreator)
mapCreator
Supplier<Map<String, V>>
The supplier to create the underlying map.
return
KeyMap<V>
A new empty KeyMap instance.
Example:
KeyMap<Integer> keyMap = manager.createKeyMap(HashMap::new);
keyMap.put(manager.getKey(Material.DIAMOND), 64);
keyMap.put(manager.getKey(Material.EMERALD), 32);

createKeyMap (from map)

Create a new KeyMap instance from the given map.
<V> KeyMap<V> createKeyMap(Supplier<Map<String, V>> mapCreator, Map<Key, V> map)
mapCreator
Supplier<Map<String, V>>
The supplier to create the underlying map.
map
Map<Key, V>
The map to create KeySet from.
return
KeyMap<V>
A new KeyMap instance containing the map elements.
If the provided map is also a KeyMap, the exact same instance of the map is returned. Otherwise, the returned KeyMap is a copy of that map.
Example:
Map<Key, Integer> values = new HashMap<>();
values.put(manager.getKey(Material.DIAMOND), 64);
values.put(manager.getKey(Material.EMERALD), 32);

KeyMap<Integer> keyMap = manager.createKeyMap(HashMap::new, values);

Build docs developers (and LLMs) love