SevenIndex Posted April 10, 2025 Report Posted April 10, 2025 Sorry about the confusing title, I'm not very familiar with coding terminology. I'm trying to add a custom arrow type but the arrowhead's model is stuck as the stone one instead of metal. The code to add it into the shapeByType list already works, but I theorize it's being placed at the bottom of the list so it gets overridden by the line above it. Which turns any prior undefined arrowhead type into the stone model. If anyone more knowledgeable about patching and knows of way to move my custom item higher in the list please let me know! I imagine this is how it is laid out: Spoiler shapeByType: { "*-copper": { "base": "item/tool/arrowhead-copper" }, "*-tinbronze": { "base": "item/tool/arrowhead-copper" }, "*-bismuthbronze": { "base": "item/tool/arrowhead-copper" }, "*-blackbronze": { "base": "item/tool/arrowhead-copper" }, "*-gold": { "base": "item/tool/arrowhead-copper" }, "*-silver": { "base": "item/tool/arrowhead-copper" }, "*-iron": { "base": "item/tool/arrowhead-copper" }, "*-steel": { "base": "item/tool/arrowhead-copper" }, "*-meteoriciron": { "base": "item/tool/arrowhead-copper" }, "*": { base: "item/tool/arrowhead-stone" }, "*-carbonized": { "base": "item/tool/arrowhead-copper" } <-- Custom item }, And this is the patch I made: Spoiler [ { "op": "addmerge", "path": "/shapeByType", "value": { "*-carbonized": { "base": "item/tool/arrowhead-copper" } }, "file": "itemtypes/toolhead/arrowhead.json", "side": "Server" }, { "op": "addeach", "path": "/variantgroups/0/states/10", "value": [ "carbonized" ], "file": "itemtypes/toolhead/arrowhead.json", "side": "Server" } ]
Brady_The Posted April 10, 2025 Report Posted April 10, 2025 (edited) 35 minutes ago, SevenIndex said: The code to add it into the shapeByType list already works, but I theorize it's being placed at the bottom of the list so it gets overridden by the line above it. You are right, that's exactly what is happening. (Note: Technically this only happens because the line above is a catch-all wildcard ("*").) You can solve this issues by using the move operation. Edited April 10, 2025 by Brady_The 1
SevenIndex Posted April 10, 2025 Author Report Posted April 10, 2025 1 hour ago, Brady_The said: You are right, that's exactly what is happening. (Note: Technically this only happens because the line above is a catch-all wildcard ("*").) You can solve this issues by using the move operation. Worked like a charm! Thanks again! 1
Recommended Posts