Size - SubnauticaModding/Nautilus GitHub Wiki
How can I edit an item's size?
To edit an item's size, you need to call CraftDataHandler.SetItemSize(), a method sitting in the SMLHelper.V2.Handlers namespace
Overloads
There are two overloads for this method
CraftDataHandler.SetItemSize([TechType] techType, [Vector2int] size);
CraftDataHandler.SetItemSize([TechType] techType, [int] x, [int] y);
Parameters
[TechType] techTypeis the item for which you want to modify the size. This can be both an existing and a custom item.
Example: TechType.CreepvineSeedCluster
[Vector2int] sizeis the desired size of the item. This value contains an[int] xvalue which refers to width and an[int] yvalue which refers to height. You can also use the[int] xand[int] yvalues outside of theVector2int, using the other overload
Example: new Vector2int(1, 1)
[int] xis the desired width of the item
Example: 1
[int] yis the desired height of the item
Example: 1
Usage
Using this knowledge, if we wanted to add make the Creepvine Seed Cluster take less space in the inventory, we could do this:
CraftDataHandler.SetItemSize(TechType.CreepvineSeedCluster, 1, 1);
or, this:
CraftDataHandler.SetItemSize(TechType.CreepvineSeedCluster, new Vector2int(1, 1));
Congratulations! You have successfully changed an item's size!
(By the way, there is a mod called Custom Item Sizes made by AlexejheroYTB which allows you to change the size of an item from the config.json file. You can check it out here)