Skip to content

fix: recognize CraftEngine items in value lookups (#428)#429

Merged
tastybento merged 1 commit intodevelopfrom
fix/428-craftengine-display-name
May 9, 2026
Merged

fix: recognize CraftEngine items in value lookups (#428)#429
tastybento merged 1 commit intodevelopfrom
fix/428-craftengine-display-name

Conversation

@tastybento
Copy link
Copy Markdown
Member

Closes #428.

Summary

  • Level.getCustomBlockId checks CraftEngine via CraftEngineHook.getItemId, so a held CraftEngine custom item is mapped to its namespaced ID instead of falling back to the vanilla material (PAPER, which has no value).
  • Utils.getCustomBlockItemStack delegates to CraftEngineHook.getItemStack, so the value panel renders the real custom-block icon.
  • Utils.getCustomBlockDisplayName now also reads the modern minecraft:item_name component (hasItemName/getItemName) that CraftEngine uses, in addition to the legacy display.Name used by Oraxen, Nexo, and ItemsAdder.
  • IslandValueCommand.printValue routes string IDs through the same getCustomBlockItemStack / getCustomBlockDisplayName path the panel already uses, so chat output shows the configured display name instead of the prettified namespaced key.

Why

Issue #428 reports that with the new CraftEngine integration, custom blocks render as a generic paper icon labelled by the raw namespaced key, and /is value hand reports "no value" for held custom items. The earlier icon/name fix from #426 had no CraftEngine branches in Utils.getCustomBlockItemStack or Level.getCustomBlockId, so CraftEngine never reached those code paths.

Dependency

Requires the BentoBox getItemId helper from BentoBoxWorld/BentoBox#2973. Once merged and published as a snapshot, this PR can land. (Local testing was done against a 3.15.1-SNAPSHOT-LOCAL build of BentoBox develop + the #2973 branch.)

Test plan

  • All 216 existing tests pass against locally-built BentoBox snapshot
  • In-game: /is value hand on a CraftEngine custom item now reports the configured value with the configured display name
  • In-game: value panel shows real CraftEngine icon and item-name (no more PAPER + prettified key)
  • CI green once #2973 is merged and snapshot is published

🤖 Generated with Claude Code

Three call sites were missing CraftEngine support, so /is value hand
returned "no value" for held CraftEngine items, the value panel showed
a paper icon with the prettified namespaced key, and the chat output
used the raw key instead of the configured display name:

- Level.getCustomBlockId now checks CraftEngineHook.getItemId, so a
  held custom item is mapped to its namespaced ID.
- Utils.getCustomBlockItemStack now delegates to
  CraftEngineHook.getItemStack so the panel renders the real icon.
- Utils.getCustomBlockDisplayName now also reads the modern
  minecraft:item_name component (hasItemName/getItemName) used by
  CraftEngine, in addition to the legacy display.Name used by Oraxen,
  Nexo, and ItemsAdder.
- IslandValueCommand.printValue routes string IDs through the same
  getCustomBlockItemStack/getCustomBlockDisplayName path used by the
  panel, so the chat message shows the configured display name.

Requires BentoBox >= 3.15.1-SNAPSHOT (BentoBoxWorld/BentoBox#2973 for
the new getItemId helper).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tastybento tastybento merged commit e5470ee into develop May 9, 2026
1 check failed
@tastybento tastybento deleted the fix/428-craftengine-display-name branch May 9, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Icons don't work

1 participant