DecentHolograms
DecentHolograms copied to clipboard
CustomModelData does not show in hologram items
Just making sure
- [X] I have read the wiki and made sure, this feature is not yet in the plugin.
- [X] I believe, that this feature is possible to implement.
- [X] I made sure, that this feature has not been requested yet.
Feature
Currently, CustomModelData does not show up on itemstacks in hologram lines (1.14+). This could be trivially implemented as easily as item durability in holograms.
Question: How do you actually apply the custom model data? (Also, why did you edit out parts of your issue?)
Question: How do you actually apply the custom model data? (Also, why did you edit out parts of your issue?)
I'm simply using DHAPI.addHologramLine(hologram.getPage(1), itemStack);
and in this case the itemStack has model data. I took a look and model data doesn't seem to be implemented in ItemBuilder.class, referenced in HologramItem.fromItemStack, nor is it parsed in HologramItem#parseContent.
Also I edited it because it left in the template info for fields I didn't fill out and figured reading that would be a waste of time.
Hello, you can only set custom model data in the string format of items. (As you would outside of API) The problem is, that it's quite difficult to get the custom model data from an existing ItemStack. We would have to access the NBT and I will eventually do that but for now, it's best to just use the string format and add custom model data though the NBT argument.
Example: #ICON: DIAMOND_SWORD {CustomModelData:1}
Hello, you can only set custom model data in the string format of items. (As you would outside of API) The problem is, that it's quite difficult to get the custom model data from an existing ItemStack. We would have to access the NBT and I will eventually do that but for now, it's best to just use the string format and add custom model data though the NBT argument.
Example:
#ICON: DIAMOND_SWORD {CustomModelData:1}
At least for newer versions is there a getCustomModelData in the ItemMeta class afaik. So for those would this stuff exist... Not sure how it would be done on older versions tho
Yeah, there is the ItemMeta#getCustomModelData()
method. It's pretty annoying that this data is not kept through the API :/
Any news on this?
Any news ?
Hello, this feature has been added in 2.8.5. CustomModelData now gets preserved when used on a custom ItemStack, in hologram line content.
Hey @d0by1, I found a small issue, API v2.8.5 gives me a error that de.tr7zw:item-nbt-api:jar:2.12.1 was not found in the maven repo, while v2.8.4 doesn't, is there any maven repo I need to install besides jitpack?
That sounds like a bad transistive dependency here... You shouldn't have to include the Item-NBT-API as DH only uses it for getting specific item values...
Also, DH should include the dependency itself as it is defined as an implementation and also relocated. Tho, that's all I can say here...