http://breezewiki.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion/minecraft/wiki/Barrel
For example, to lock a barrel at (0,64,0) so that the barrel cannot be opened unless the player is holding an item named "Barrel Key", use / data merge block 0 64 0 {Lock:"Barrel Key"} . Changing profession If a village has a barrel that has not been claimed by a villager, any villager who does not have a chosen job site block has a chance to change their profession into a fisherman.