Jump to content

DropItemFromInvTile with caves

Recommended Posts

I am trying to make a mod based on 'Drop your lantern on the ground' that will drop a single lightbulb on the ground from your stack. I can basically follow the same patterns used in the original mod, however to drop a *single* lightbulb I am calling DropItemFromInvTile(item, 1). This seems to work in worlds where caves are disabled, but when caves are enabled it doesn't drop anything. Does anyone know how to fix this?

Original mod: https://steamcommunity.com/sharedfiles/filedetails/?id=1659235004


Link to comment
Share on other sites

Posted (edited)

Well, I looked inside "inventory_replica.lua" and it seems that "DropItemFromInvTile" requires an entity and a boolean... that would mean that you need to replace the 1 with true.


DropItemFromInvTile(item, true)

This way, you will drop one item from the stack.

Edited by HarryPPP
  • Like 1
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

  • Create New...