🛌ISleep

ISleep is a lightweight and customizable plugin for Minecraft servers that enhances the bed mechanics, allowing administrators to control how and when players can sleep and set spawn points. This plugin offers options to bypass Minecraft's default restrictions (such as time, safety, or distance), supports multiple versions, and includes customizable bed explosion mechanics in unsafe dimensions, all with fully configurable messages and seamless integration.

Main Features

🛏️ Advanced Bed Management

  • Restriction Control: Bypass Minecraft's default restrictions for sleeping, including time, distance, safety, dimension, or sneaking requirements.

  • Customizable Explosions: Option to trigger explosions when using beds in unsafe environments (Nether/End).

  • Spawn Point Management: Configure spawn point settings across different dimensions.

  • Version Compatibility: Supports hostile entity checks for Minecraft versions 1.13 to 1.21+.

  • Lightweight Design: Minimal performance impact with efficient event handling.

📢 Customizable Messaging

  • MiniMessage Support: Fully customizable messages with MiniMessage formatting for rich text.

  • Player Feedback: Clear feedback for players when sleep is denied or spawn points are set.

  • Prefix Customization: Configurable prefix for all plugin messages.

⚙️ Administrative Tools

  • Reload Command: Instantly reload the plugin configuration without restarting the server.

  • Leave Command: Allow players to exit beds programmatically.

  • Permission System: Granular permission control for administrative tasks.

Configuration

Complete Configuration File

# Version of the configuration file / plugin, do not
# modify this file or you will disrupt the
# version and a new file will be created.
Config-Version: 1.0
Plugin-Version: 1.0-SNAPSHOT

# Require players to sneak to use beds
SneakOnly: false

# Ignore dimension restrictions (e.g., Nether/End)
IgnoreWhere: true

# Ignore time restrictions (e.g., can sleep during day)
IgnoreTime: true

# Ignore safety restrictions (e.g., hostile mobs nearby)
IgnoreSafety: false

# Ignore distance restrictions (e.g., too far from bed)
IgnoreDistance: true

# Ignore other problems preventing sleep
IgnoreOthers: true

# Trigger explosions in unsafe dimensions (Nether/End) if IgnoreSafety is false
ExplodeOnUnsafe: false

# Caution! This option may break the End
SetSpawnInOtherDimensions: false

# Plugin messages, customizable with MiniMessage formatting
Messages:
  Prefix: '<aqua>Fruit<white>Forge <gray><bold>»</bold> <reset>'
  NoPermission: '<red>You lack permission to execute this command.'
  ConsoleNotAllowed: '<red>This command is player-only.'
  Ejected: '<green>You have been ejected from the bed.'
  NotSleeping: '<red>You are not currently sleeping.'
  Reloaded: '<green>Configuration reloaded successfully.'
  NotSafe: '<red>Monsters are nearby; cannot set spawn.'
  NotPossibleNow: '<red>It is not possible to sleep now.'
  TooFarAway: '<red>You are too far from the bed.'
  NotSneaking: '<red>You must be sneaking to use the bed.'
  NotPossibleHere: '<red>You cannot sleep in this dimension.'
  OtherProblem: '<red>There is another problem preventing sleep.'
  SpawnSet: '<green>Spawn point set successfully.'

Configuration Options

General Settings

  • SneakOnly: true/false - Require players to be sneaking to use beds.

  • IgnoreWhere: true/false - Allow sleeping in any dimension (e.g., Nether/End).

  • IgnoreTime: true/false - Allow sleeping at any time, bypassing day/night checks.

  • IgnoreSafety: true/false - Ignore nearby hostile mobs when setting spawn points.

  • IgnoreDistance: true/false - Allow bed use regardless of player distance from the bed.

  • IgnoreOthers: true/false - Ignore other miscellaneous restrictions for sleeping.

  • ExplodeOnUnsafe: true/false - Cause beds to explode in unsafe dimensions (Nether/End) if safety checks fail.

  • SetSpawnInOtherDimensions: true/false - Allow setting spawn points in non-Overworld dimensions (⚠️ may cause issues in the End).

Messages

All messages support MiniMessage formatting:

  • Prefix: Prefix for all plugin messages.

  • NoPermission: Shown when a player lacks permission for a command.

  • ConsoleNotAllowed: Shown when a command is executed from the console.

  • Ejected: Confirmation message when a player is ejected from a bed.

  • NotSleeping: Shown when a player tries to leave a bed but isn't sleeping.

  • Reloaded: Confirmation message for successful configuration reload.

  • NotSafe: Shown when hostile mobs prevent spawn point setting.

  • NotPossibleNow: Shown when time restrictions prevent sleeping.

  • TooFarAway: Shown when the player is too far from the bed.

  • NotSneaking: Shown when sneaking is required but the player isn't sneaking.

  • NotPossibleHere: Shown when dimension restrictions prevent sleeping.

  • OtherProblem: Shown for other issues preventing sleep.

  • SpawnSet: Confirmation message when a spawn point is successfully set.

Commands

/sleepreload

Reloads the plugin configuration.

  • Permission: isleep.admin

  • Usage: /sleepreload

  • Aliases: /sleeprl

  • Description: Reloads the plugin's configuration file without restarting the server.

/leave

Ejects the player from a bed if they are sleeping.

  • Permission: None (available to all players)

  • Usage: /leave

  • Aliases: /leavebed, /exit

  • Description: Forces the player to exit the bed and displays a confirmation message.

Permissions

Permission
Description
Default

isleep.admin

Allows reloading the plugin configuration

OP

How It Works

  1. Bed Interaction: The plugin listens for PlayerBedEnterEvent and PlayerInteractEvent to manage bed usage.

  2. Restriction Checks: Evaluates conditions like sneaking, dimension, time, safety, and distance based on configuration settings.

  3. Hostile Mob Detection: Checks for nearby hostile mobs (e.g., Zombies, Skeletons) with version-specific entity support (1.13 to 1.21+).

  4. Explosion Handling: Optionally triggers explosions in unsafe dimensions (Nether/End) if configured.

  5. Spawn Management: Sets or preserves spawn points based on dimension and configuration settings.

  6. Message Feedback: Provides clear, customizable feedback to players using MiniMessage formatting.

Installation

  1. Download the ISleep plugin .jar file.

  2. Place it in your server's plugins/ folder.

  3. Ensure ProtocolLib is installed (required dependency).

  4. Restart the server to generate the configuration file.

  5. Customize Settings.yml in the plugins/ISleep/ folder as needed.

  6. Use /sleepreload to apply changes without restarting.

Compatibility

  • Minecraft Version: 1.13 - 1.21+

  • Server Software: Spigot, Paper, Purpur

  • Dependencies: ProtocolLib (required)

  • Optional Dependencies: None

Troubleshooting

Common Issues

  • Beds not working as expected:

    • Verify configuration settings (e.g., IgnoreWhere, IgnoreTime).

    • Check for conflicting plugins affecting bed mechanics.

    • Ensure ProtocolLib is installed and up-to-date.

  • No messages displayed:

    • Confirm MiniMessage formatting in Messages section is valid.

    • Check server logs for errors.

  • Explosions not triggering:

    • Ensure ExplodeOnUnsafe is set to true and IgnoreSafety is false.

    • Verify the player is in Nether/End.

  • Spawn points not setting:

    • Check SetSpawnInOtherDimensions setting.

    • Ensure no other plugins override spawn mechanics.

Debug Information

  • Plugin logs events and errors to the server console.

  • Enable debug mode in ProtocolLib for additional insights if needed.

  • Verify configuration validity on startup.

Support

For support, bug reports, or feature requests:

  • Discord: https://fruitforge.com/discord

  • Donations: https://fruitforge.com/paypal


Plugin developed by FruitForge Studio

Last updated