A player may sleep in any unclaimed bed. A player may not sleep in a bed claimed by someone else. If a player sleeps in a different unclaimed bed, the player's previous bed will become unclaimed and he will claim the new bed.
The plugin will recognize a "double bed" as one bed, but a big pile of beds will confuse it.
IMPORTANT! This is NOT the same as grief-protection. This plugin doesn't keep track of who placed or broke any beds, and won't prevent a bed from being placed or broken -- use a grief-protection plugin for that.
A given player can build a "hotel" full of beds for other players to sleep in, and the above rules will apply to players sleeping in those "hotel" beds.
The /BED command tells you where your bed is in case you forget. If you are OP and wielding your OP stick, it also tells you where everybody's beds are.
To install this plugin, copy the plugin JAR file to your server's plugins folder.