Skip to content

ItemContext

github-actions edited this page Apr 8, 2025 · 7 revisions

Contextual information about an item, used to simplify similar json calls

ItemContext(self, rm: Any, res: ResourceLocation)

Methods

Shortcut for ResourceManager#item_model

with_item_model(self, *textures: Json, parent: str = 'item/generated', no_textures: bool = False, overrides: Any = None) -> ItemContext
  • textures: Json the textures for the model. Defaults to 'domain:item/name/parts'
  • parent: str the parent model.
  • no_textures: bool if the textures element should be ignored
  • overrides: Any overrides to add to the item model if present

Shortcut for ResourceManager#item_tag

with_tag(self, tag_name_parts: Sequence[str] = None, replace: bool = None) -> ItemContext
  • tag_name_parts: Sequence[str] The resource location for the tag
  • replace: bool If the tag should replace previous values

Shortcut for ResourceManager#lang with the item name

with_lang(self, item_name: str, language: str | None = None) -> ItemContext

Clone this wiki locally