Repository navigation
Utilities
Crystal Spider edited this page Nov 15, 2026
·
2 revisions
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 aIdentifier. -
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 aIdentifier. -
ItemUtils#getStringKey(Item)
Returns the in-game ID of the given item as a string.
Use it.crystalnest.cobweb.api.platform.PlatformQueries from common code on Fabric and NeoForge. The Platform and Environment enums are in it.crystalnest.cobweb.platform.model.
| Method | Result |
|---|---|
loader() |
The active loader as a Platform. |
environment() |
Environment.DEVELOPMENT or Environment.PRODUCTION. |
isDevelopment() |
Whether the active loader reports a development environment. |
isModLoaded(modId) |
Whether the mod is loaded in this game instance. |
loadedModIds() |
A sorted, unmodifiable list of the IDs reported by the local loader. |
modVersion(modId) |
The loader's version string, or an empty optional if the mod is absent. |
Mod queries are available once the loader makes its mod list available during initialization.
If you have any suggestions or questions about this wiki, please open an issue following the Documentation enhancement template.