Jump to content

Recommended Posts

Posted (edited)

Hey all, I'm having trouble getting liquids to work in the mod I'm working on with a friend and it seems no matter what i do they just wont register as blocks. 
At best, the liquid WILL show up as a item, but it wont appear in a bucket in the creative inventory and if I try and use the existing base game code for liquids with the added "[ { type: "block", code: "game:woodbucket", attributes: { ucontents: [ { type:"item", code: "gggenchem:dissolvedsulfur", makefull: true } ] } } ]" section formatted correctly, it just crashes the same as This existing thread.

I'd appreciate any and all helpw ith this because the wiki doesnt have much in the way of guides for custom liquids, and even attempts at reverse engineering the code for other mods liquids hasnt gone very far 😭.
 

dissolvedsulfur.json dissolvedsulfurportion.json

image.png

Edited by RoboGlizzy
image didn't embed
Posted (edited)

I will share something I found out similar to your issue. I was making a block and I was having the darnest time. The game kept thinking it was an item and not a block. It turns out the folder that you place your files matter. I had placed my file which was supposed to be a blockType inside a folder named itemTypes. Bottom line is you can take the same file and if you place it in itemtypes it will be an item. If you place in blocktypes it will be a block. Maybe if you do that with whatever it is that fluids need then the game will be able to read it?

 

Looking at your screenshot your asset says "game:item-dissolvedsulfurportion" and not 'game:block-dissolvedsulfurportion" or "game:fluid-dissolvedsulfurportion". That leads me to believe that you placed your main "types" file in the "itemtypes" folder inside your mod. You might need to place it in the folder designated for fluids. Once again I dont know what folder that is since I'm only familiar with "itemTypes" and "blockTypes".

 

You know what I'm looking in to this for my own personal mod as well. I will let you know what I find out.

Edited by ZergMazter
  • 2 weeks later...
Posted

Are you sure you are not missing the ending "} ]" that would close line "creativeinventoryStacks: [ {"? I've done this and crashed my game so many times. It's always the silliest things. Should look like:

creativeinventoryStacks:

[ { tabs: ["general", "liquids"], stacks: [ { type: "block", code: "game:woodbucket", attributes: { ucontents: [ { type:"item", code: "gggenchem:dissolvedsulfur", makefull: true } ] } } ] } ],

Posted

Also your mod's name doesn't need to be named. Instead of gggenchem:dissolvedsulfur try dissolvedsulfur. Your mod will look in its folders firsts and assume your mod is priority by default. I dont know if that matters but I only call a mod's "name" or "game" to look for files outside of my mod.

Posted (edited)

Fixed:

I literally took this code from the "Clay Casting" mod and applied my own fluid to it and I got buckets with the fluid and no crash. Adjusted to your mod if you copy and paste this code exactly as is then you will have no crash. After that just slowly change the texture/shape/creativetab paths and you are set:

 

{
    code: "dissolvedsulfur",
    class: "ItemLiquidPortion",
    matterState: "liquid",
    variantgroups: [
        { code:"type", states: ["whatever1", "whatever2"], }
    ],
    attributes: {
        handbook: {
            ignoreCreativeInvStacks: true
        },
        waterTightContainerProps: {
            containable: true,
            itemsPerLitre: 100,
            isopaque: true,
            texture: { base: "liquid/{type}" },
            allowSpill: true,
            whenSpilled: {
                action: "DropContents",
                stack: { type: "item", code: "dissolvedsulfur-{type}" }
            }
        }
    },
    shape: { base: "liquid" },
    texture: { base: "liquid/{type}" },
    creativeinventoryStacks: [ { tabs: ["general", "liquids", "rat"], stacks: [ { type: "block", code: "game:woodbucket", attributes: { ucontents: [ { type:"item", code: "gggenchem:dissolvedsulfur-{type}", makefull: true } ] } } ] } ],
    maxstacksize: 5000,
    materialDensity: 200,
    guiTransform: {
        translation: { x: 0, y: 1, z: 0 },
        rotation: { x: 123, y: -33, z: -13 },
        origin: { x: 0.5, y: 0, z: 0.5 },
        scale: 1.4
    },
    fpHandTransform: {
        translation: { x: 0, y: 0, z: 0 },
        rotation: { x: 25, y: 157, z: -5 }
    },
    tpHandTransform: {
        translation: { x: -1.5, y: -1, z: -1.4 }
    }
}

 

I also named the json in itemtypes/liquid as the code name up top dissolvedsulfur. The path reads itemtypes/liquid/dissolvedsulfur.

Edited by ZergMazter
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.