-
Notifications
You must be signed in to change notification settings - Fork 2
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)Shortcut for ResourceManager#item_model
with_item_model(self, *textures: Json, parent: str = 'item/generated', no_textures: bool = False, overrides: Any = None) -> ItemContext-
textures: Jsonthe textures for the model. Defaults to 'domain:item/name/parts' -
parent: strthe parent model. -
no_textures: boolif the textures element should be ignored -
overrides: Anyoverrides 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: boolIf 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