An alternate solution is to use Fomar0153's multiple inventory scripts. And switch the inventory setting via script to "jail".
then when jail time is over you can merge the two inventory to the script's default one. (in case if you can get item while your in jail anyways) but you should know a little basic scripting since it's a bit complicated.
But you can make chest with a different event content to get the desire effect of getting the item in the chest upon merging.
Links to the script is below.
Script:
Multiple inventory
http://www.rpgmakervxace.net/topic/1433-multiple-inventories/
And here a quick tutorial on how to get the chest effect via that script.
1. Make a chest or guard event that trigger if a particular condition branch switch set to true
2. Make a text that say that you got your item back.
3. Make a another line in the event via script command with the text.
$game_party.merge_inventories(DEFAULT, JAIL)4. Make sure that the script settings "
ERASE_WHEN_MERGE" is set to true to avoid duplicate but it's optional. But make sure that the inventory you like to erase "(DEFAULT,
JAIL)" (Marked in red) is in the second after the first inventory.
5. Use a switch to disable the event to avoid duplicating.
But make sure that you set your inventory from the beginning of your jail time to jail or anything you like to called it.
$game_party.change_inventory(name)Edited for better understanding.