|
| 1 | +# BackToDeath Plugin |
| 2 | + |
| 3 | +A powerful PocketMine-MP plugin that allows players to teleport back to their last death location with a simple command. |
| 4 | + |
| 5 | +## 📋 Features |
| 6 | + |
| 7 | +- **Death Location Tracking**: Automatically records player death positions |
| 8 | +- **Easy Teleportation**: Use `/back` command to return to your last death point |
| 9 | +- **Permission System**: Control who can use the back command |
| 10 | +- **Cooldown System**: 5-minute cooldown to prevent command spam |
| 11 | +- **World Management**: Automatically loads worlds if they're not already loaded |
| 12 | +- **Memory Efficient**: Uses lightweight caching system |
| 13 | + |
| 14 | +## 🚀 Installation |
| 15 | + |
| 16 | +1. Download the latest `BackToDeath.phar` file from releases |
| 17 | +2. Place the `.phar` file in your server's `plugins/` directory |
| 18 | +3. Restart your server |
| 19 | +4. The plugin will automatically enable and be ready to use |
| 20 | + |
| 21 | +## ⚙️ Configuration |
| 22 | + |
| 23 | +The plugin now supports configuration through `config.yml` file. Server owners can customize cooldown times and messages. |
| 24 | + |
| 25 | +### Configuration Options: |
| 26 | + |
| 27 | +```yaml |
| 28 | +# BackToDeath Plugin Configuration |
| 29 | + |
| 30 | +# Cooldown settings |
| 31 | +cooldown: |
| 32 | + # Cooldown time in seconds (default: 300 seconds = 5 minutes) |
| 33 | + time: 300 |
| 34 | + |
| 35 | +# Message settings |
| 36 | +messages: |
| 37 | + # Message when command is used from console |
| 38 | + console_only: "§cThis command can only be used in-game." |
| 39 | + |
| 40 | + # Message when player doesn't have permission |
| 41 | + no_permission: "You Dont Have Permission To Use This Command." |
| 42 | + |
| 43 | + # Message when command is on cooldown |
| 44 | + on_cooldown: "You must wait some more!" |
| 45 | + |
| 46 | + # Message when player hasn't died recently |
| 47 | + no_death: "You haven't died recently!" |
| 48 | + |
| 49 | + # Message when teleportation is successful |
| 50 | + success: "You have been successfully teleported to your last death point." |
| 51 | +``` |
| 52 | +
|
| 53 | +To modify these settings: |
| 54 | +1. Edit the `plugins/BackToDeath/config.yml` file |
| 55 | +2. Restart your server or reload the plugin |
| 56 | +3. Changes will take effect immediately |
| 57 | + |
| 58 | +## 🔧 Commands |
| 59 | + |
| 60 | +### `/back` |
| 61 | +Teleports you to your last death location. |
| 62 | + |
| 63 | +**Usage:** `/back` |
| 64 | + |
| 65 | +**Permission:** `back.cmd.use` (default: op) |
| 66 | + |
| 67 | +**Cooldown:** Configurable (default: 5 minutes) |
| 68 | + |
| 69 | +## 🔐 Permissions |
| 70 | + |
| 71 | +| Permission | Description | Default | |
| 72 | +|------------|-------------|---------| |
| 73 | +| `back.cmd.use` | Allows players to use the `/back` command | op | |
| 74 | + |
| 75 | +## 🎯 How It Works |
| 76 | + |
| 77 | +1. When a player with permission dies, their death location is automatically recorded |
| 78 | +2. The location is stored in memory (X, Y, Z coordinates and world name) |
| 79 | +3. When the player uses `/back`, the plugin: |
| 80 | + - Checks if they have permission |
| 81 | + - Verifies they have a stored death location |
| 82 | + - Ensures the cooldown period has expired |
| 83 | + - Loads the world if necessary |
| 84 | + - Teleports the player to their death location |
| 85 | + - Sets a new 5-minute cooldown |
| 86 | + |
| 87 | +## 🏎️ Performance |
| 88 | + |
| 89 | +The BackToDeath plugin utilizes a **high-performance SQLite caching system** for storing player death locations and cooldowns. This ensures: |
| 90 | +- **No Lag**: Efficient data retrieval and storage minimizes server load. |
| 91 | +- **Stable Performance**: Data persists across server restarts, providing a reliable experience for players. |
| 92 | + |
| 93 | +## 📝 API Compatibility |
| 94 | + |
| 95 | +- **PocketMine-MP API**: 5.0.0+ |
| 96 | +- **PHP Version**: 8.0+ |
| 97 | + |
| 98 | +## 🐛 Troubleshooting |
| 99 | + |
| 100 | +**Q: I get "You haven't died recently!" message** |
| 101 | +A: This means the plugin doesn't have a recorded death location for you. Die first, then use `/back`. |
| 102 | + |
| 103 | +**Q: I get "You must wait some more!" message** |
| 104 | +A: You need to wait 5 minutes between uses of the `/back` command. |
| 105 | + |
| 106 | +**Q: The command doesn't work for non-op players** |
| 107 | +A: By default, only operators have permission. You can change this in your permissions configuration. |
| 108 | + |
| 109 | +## 🤝 Support |
| 110 | + |
| 111 | +If you encounter any issues or have suggestions: |
| 112 | +1. Check this README for common solutions |
| 113 | +2. Ensure you're using a compatible PocketMine-MP version |
| 114 | +3. Verify the plugin is properly installed |
| 115 | + |
| 116 | +## 📄 License |
| 117 | + |
| 118 | +This plugin is provided as-is. Feel free to modify and distribute with proper credit. |
| 119 | + |
| 120 | +## 🏆 Credits |
| 121 | + |
| 122 | +**Developer**: Biswajit |
| 123 | +**Plugin Name**: BackToDeath |
| 124 | +**Version**: 1.0.0 |
| 125 | + |
| 126 | +--- |
| 127 | + |
| 128 | +⭐ **Enjoy the convenience of returning to your death locations with ease!** ⭐ |
0 commit comments