Page 1 of 1

[0.10.9] Preplayermineditem called at the wrong time

Posted: Sat Aug 30, 2014 5:35 pm
by Rseding91
The preplayermineditem event isn't called at the right time; it's only called if the player mined a entity and was able to hold everything the item was holding instead of as the event name suggest: before the mining starts.

In two of my mods I use the "preplayermineditem" events to simulate picking up entities contents and all by storing the inventory contents onpreplayermineditem, emptying the entity inventory contents and then letting the game pick up the empty inventory (chest). When it gets placed back down later I use onbuilt to restore the inventory contents.

As it is now, the game empties the entire chest before calling onpreplayermineditem so it's always empty by the time the script sees it was mined.


What's expected:
  • Player mines entity: onpreplayermineditem is called
  • Standard inventory transfer of any items still in the chest are performed
  • If the inventory transfer was successful: onplayermineditem is called for the contents of the inventory
What happens:
  • Player mines entity:
  • Standard inventory transfer of any items in the chest are performed
  • If the inventory transfer was successful: onpreplayermineditem is called
  • onplayermineditem is called for the contents of the inventory
I don't know if this is so much a bug as it is a major change in how the events where processed.

Re: [0.10.9] Preplayermineditem called at the wrong time

Posted: Wed Sep 10, 2014 12:43 pm
by kovarex
So it is fixed for 0.10.10