When a player is in certain controllers, such as ghost when waiting to respawn, the property "mining_state" is readable but not writable. From the API docs it is not clear what the full criteria for having a "manual miner" are, so it is not possible to check if the property is writable. That first part feels like a doc issue, but I am reporting it as a bug because the different behaviours between readining and writing when there is no "manual miner". Because of the read behaviour, I would expect it to only error when attempting to set mining to true, and for this to be documented; although you may decide it better to error on read and document which check to perform before accessing the property.
Reproduction:
Code: Select all
/c game.player.ticks_to_respawn = 7200
/c game.player.mining_state = { mining = false }

