game
Live objects live on player and world. game answers what stays put.
| Function | Returns |
|---|---|
game.item(id) |
Item handle for that id's default stack |
game.items() |
Array of every vanilla item id (minecraft: namespace, no air), in registry order |
game.translate(key, ...) |
The key translated through the client language; extra args fill %s slots |
game.has_translation(key) |
Whether the client language knows the key |
game.language() |
Language code, e.g. "en_us" |
print(game.translate("block.minecraft.stone")) -- "Stone", or the localized name
local apple = game.item("minecraft:golden_apple")
print(apple:name(), apple:food().nutrition)
for _, id in ipairs(game.items()) do
print(id, game.item(id):max_count())
end