Page 1 of 1
Document that player.get_main_inventory() will be nil while in remote view
Posted: Thu Dec 19, 2024 2:26 pm
by i142857
The current documentation seems to suggest that the only case where it can be nil is if the entity is not a player. But in my testing, it's also nil if you're looking at the map/remote view. This is unexpected (intuitively, why would player.get_main_inventory() not work just because the player is looking at the map?). So I would suggest documenting this.
Re: Document that player.get_main_inventory() will be nil while in remote view
Posted: Thu Dec 19, 2024 2:33 pm
by PennyJim
There is an angle where this is a bug rather than a documentation issue. I think I sit in that angle
Re: Document that player.get_main_inventory() will be nil while in remote view
Posted: Thu Dec 19, 2024 5:13 pm
by curiosity
PennyJim wrote: Thu Dec 19, 2024 2:33 pm
There is an angle where this is a bug rather than a documentation issue. I think I sit in that angle
The only report is listed as "not a bug", you might consider trying your luck with an API request.
Re: Document that player.get_main_inventory() will be nil while in remote view
Posted: Thu Dec 19, 2024 5:47 pm
by PennyJim
Bah :(
I can kind of understand it.. with a get physical inventory, I think I'd be more okay
Re: Document that player.get_main_inventory() will be nil while in remote view
Posted: Thu Dec 19, 2024 6:19 pm
by curiosity
Personally, I think the current behavior makes sense. You don't have an inventory when in remote view. And I bet it would return nil for some other controllers too, like spectator. All of them should be documented.