JeanPierre Posted January 17 Report Posted January 17 (edited) Hi! I'm a newbie modder so I humbly ask for some advice on a feature in my jug mod. I want to make jugs attachable to elk. I partially succeeded: empty jugs can be attached, but once they contain a drinkable liquid they become unattachable. Any ideas how could I force it to be attachable? Edited January 17 by JeanPierre
TheCrimsonKing96 Posted January 18 Report Posted January 18 Hey @JeanPierre, welcome to the forums! I wouldn't consider myself a very experience modder myself but I do believe that filled vessels (jugs, pots, barrels, etc.) are considered different blocks/entities compared to when they're not filled. If anyone else knows better please lemme know if I'm wrong here! How are you currently attaching the empty jugs to the elk? If you have any snippets of code I might be able to help you further (no guarantees though, sorry!) 2
JeanPierre Posted January 19 Author Report Posted January 19 Hey! Thank you, happy to be here ^^ Interesting, it would make sense since they go from block to a liquid container, however I can attach jugs filled with water which means something happens when the liquid inside is drinkable (cuz instead of attaching it, player just attempts to drink it). I'm curious if there is a way to perhaps to stop player from drinking it, therefore allowing it to be attached. To attach the jugs I used this: attachableToEntity: { categoryCode: "gear", attachShape: { base: "item/wearable/hooved/elk/wjug" }, texturePrefixCode: "moonshinejug-{color}-fired", attachedShapeBySlotCode: { "gearleft": { base: "item/wearable/hooved/elk/wjug1" }, "gearback": { base: "item/wearable/hooved/elk/wjug2" }, "gearright": { base: "item/wearable/hooved/elk/wjug3" } } } As you can see In the case of small jugs I used the gear slots to attach them there. Thanks for reaching out!
TheCrimsonKing96 Posted January 19 Report Posted January 19 Lemme dig through some of my old unreleased mods here today/tomorrow. I know I had attempted something similar in the past and ran into the same issue. There is a way to stop the player interaction from happing on an interactive object if they're looking at something else like in this case the elks gear slot. I don't recall if I ended up needing to custom code it with C# or if there is a way to flag it in JSON.
JeanPierre Posted January 19 Author Report Posted January 19 Ohhhh my god, that would be awesome. Not hyping myself up yet but thank you and I appreciate your help a lot!
Gerste Posted January 19 Report Posted January 19 Hi, I had a very similar problem while creating PetAI. Are your jugs custom made by your mod? If so, can you try adding the following to the item behaviors {"name": "considerpetfood"} If they are base game jugs you are trying to modify, please try the following: [ { "op": "add", "path": "/behaviors", "value": [ { "name": "considerpetfood" } ], "file": "game:path/to/the/item.json" } ] Then install and enable PetAI (it adds the consider pet food behavior) and check if it works. If it does, the fix is located here.
JeanPierre Posted January 19 Author Report Posted January 19 (edited) Hi! Thanks for reaching out, my jugs are indeed custom made, I tried adding {"name": "considerpetfood"} behaviour with PetAI however it did not work. My seraph kept on drinking the liquids :< I believe that drinking is at fault here, if there could be a way to for example block the player from drinking when holding ctrl that could potentially solve the issue, however im not sure where to begin witch such endeavor so i've been hoping for some possible solution using json Edited January 19 by JeanPierre
Recommended Posts