generated from Crystal-Nest/cobweb-mod-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Common API
Crystal Spider edited this page Jun 2, 2024
·
12 revisions
WIP
WIP
For both blocks and items, Cobweb provides a shorthand to retrieve their in-game IDs (e.g. Blocks.DIRT
-> minecraft:dirt
).
Blocks:
-
BlockUtils#getKey(Block)
Returns the in-game ID of the given block as aResourceLocation
. -
BlockUtils#getStringKey(Block)
Returns the in-game ID of the given block as a string.
Items:
-
ItemUtils#getKey(Item)
Returns the in-game ID of the given item as aResourceLocation
. -
ItemUtils#getStringKey(Item)
Returns the in-game ID of the given item as a string.
To prevent code duplication across various projects, Cobweb also provides enums for the Environment and the Platform.
If you have any suggestions or questions about this wiki, please open an issue following the Documentation enhancement template.