Jump to content

How to put item in container without opening it?


Recommended Posts

Hi. I'm making a mod which involves putting an item into a structure, a few operations being performed on that item, and then the structure spitting out the item(s) again. I figured using the container component would be the best way to go about this, but I don't want the player to actually see the inventory of the structure (or bother making a widget for it). So, is there a good way to put inventoryitems inside of a container without actually having a player opening it? Unfortunately, from what I tried, setting container.canbeopened to false prevents players from adding items just by clicking on the structure with an item, so is there some other way I can manage it?

Note that this structure will be able to accept literally any inventoryitem in the game. I thought I could probably get it to work by making the structure have the fueled component, and then adding any fuel it takes to the inventory of the structure, but that would entail adding the fuel component to every item in the game, which I thought would probably be a bad idea, not to mention it wouldn't work with modded items (probably).

Link to comment
Share on other sites

3 minutes ago, Aquaterion said:

Maybe look into Pig king? sounds exactly like what you want, give it items, and give back other items

no, the pig king doesn't have an inventory, he works almost identically to fueled items; anything you give him just gets converted into gold, much like how logs and charcoal get converted into fuel time.

Edited by Snowhusky5
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...