This mod allows to set items that can only be placed in the main hand (the selected inventory slot in the hotbar) or the offhand, outside those slots, the item will be dropped. I made it to nerf water and lava buckets, but can be used for any item, just add the item in the config list. I don't like the fact that a water bucket is considered a "meta", it works for too many things. So this mod allows me to make so that it is more annoying to carry a water bucket arround. By default, water and lava buckets are added in the list.
# Allow the items to be held on the main hand
B:allowMainHand=true
# Allow the items to be held in the off hand
B:allowOffHand=true
# Display a message when the item is dropped from the player inventory
B:displayMessageOnDrop=true
# Display a message when the item is picked up
B:displayMessageOnPickup=false
# List of registry names of items that this mod affects
S:restrictedItems <
minecraft:water_bucket
minecraft:lava_bucket
>