Boidster
New member
That jibes exactly with testing, but maybe we should rephrase "within the bounds of the container + 16 blocks". For practical purposes, the player must be within 8 blocks of the container.So the worldTimeTouched of the lootcontainer (which is used to check if loot should respawn) is set again when an entity of type EntityPlayer is within the bounds of the lootcontainer + 16 blocks.
Cheers
Docs for the Bounds(center, size) constructor say:
The code says to create a new bounding box with center = 'base' of the container and box size = 16. Actual extents (i.e. the respawn reset trigger distance) from the center will be 8 in each direction. The total size of the cube is 16 blocks on a side, with the container at its center.Create a new Bounds with the given center and total size. Bound extents will be half the given size.
I'm guessing that the occasional off-center results during testing were due to the 'base' of containers (mailboxes, in the case of my tests) not necessarily being in the center of the block. Or due to me not standing technically within 8 blocks (floating point vector distance) even though I was standing on the 8th block according to (integer) map coordinates.