Resource packs containing Item Model Definitions with 1000 or more condition models cause StackOverflowErrors, preventing players from adding more than 1000 component-based custom items without running into issues with the resource pack loading inconsistently.
In item model definitions the only way to read individual values inside the custom_data component is incredibly inefficient since you have to chain conditions which end up causing stack overflows when using over 1000 of them. Select properties can't work for this because they check the component strictly, checking all data inside of it and not individual values.
Steps to Reproduce
Download the attached resource pack.
Attempt to load the attached resource pack.
Notice the resource reload fails, returning a StackOverflowError
Successive attempts to load the resource pack will eventually cause it to load successfully, typically takes one or two attempts.
Making sure the resource pack is working
Once the attached resource pack loads, run the following command in a singleplayer world to verify the pack is working.
(Replace âxyzâ with any number between 1 and 999)
/give @s minecraft:player_head[custom_data={id:xyz}]
If the resource pack is working, this should give you a player head with an un-tinted Grass Block model.
Adding more data fields to the custom_data component will not change the outcome. Only the id field controls this.
Environment
MacOS Sequoia 15.5
2020 M1 MacBook Pro
Attachments
Comments 6
@tryashtar
Select properties can't work for this because they check the component strictly, checking all data inside of it and not individual values.
Thank you for your report!
After consideration, the issue is being closed as Won't Fix.
Please note that this is not the same as Working as Intended, as this bug report correctly describes behavior in the game that might not be the intended or desirable behavior, but it will not be fixed right now. Sometimes, this is because the issue reported is minor and/or impossible to change without large architectural changes to the code base.
Quick Links:
đ Bug Tracker Guidelines â đŹ Community Support â đ§ Mojang Support (Technical Issues) â đ§ Microsoft Support (Account Issues)
đ Project Summary â âď¸ Feedback and Suggestions â đ Game Wiki
While we are not looking to fix this, we think there is ways to work around this.
Use
item_model
component instead of custom dataUse
custom_model_data
andselect
instead
@Panda4994 These do not work around the problem this method solves.
Resource pack developers may not have the ability to change item data on a server if it is a fan-made pack, thus ruling out using custom_model_data and item_model.
As mentioned earlier, select only allows reading the entire component strictly, and cannot read individual values like condition can.
Currently making use of this in my Hypixel Plus resource pack (Link), since there are no other options available in vanilla that have this interaction.
I think the correct way to do this is with
select
rather than nestedcondition
s. But still, I can confirm the ticket as written.