Skip to content

screen

The currently open screen.

Function What it does
screen.current() Open screen as {type, title, handled}, or nil when none
screen.close() Closes a handled (container) screen the vanilla way

type is a stable name for common screens — "inventory", "generic_container", "anvil", "furnace", "merchant", "chat", "game_menu", "death", "sign", "book", … — and "other" for anything unrecognized.

title is a text component. handled is true for container screens (their slots answer to interaction.click_slot).

local s = screen.current()
if s and s.type == "generic_container" then
    print("looking at", s.title:string())
end
Navigation

Type to search…

↑↓ navigate↵ selectEsc close