OneWay Elytra

Compact OneWay Elytra plugin for Paper 1.21.1

34

Quick challenge

How far can you run before the mobs catch you?

OneWay Elytra

OneWay Elytra

A Minecraft plugin for Paper/Spigot 1.21.1 that implements a special Elytra system with radius-based restrictions.

---

What does this plugin do?

This plugin creates a "OneWay Elytra" system where certain Elytras can only be used within a configurable radius around a spawn point. Normal Elytras work as usual and are not affected.

Features

- Flexible removal modes: OneWay Elytras can only be worn within a defined radius around the spawn point - Flexible removal modes: - Players automatically receive a OneWay Elytra when entering the radius - The Elytra is automatically removed when players leave the radius (only when not gliding) - Flexible removal modes: - New gliding cannot be started outside the radius - Players already flying can continue their flight until landing - Flexible removal modes: When a player lands outside the radius, the Elytra is automatically removed - Flexible removal modes: - `MOVE_TO_INVENTORY`: Elytra is moved to inventory (or dropped if full) - `DROP`: Elytra is immediately deleted (cannot be picked up)

Installation

1. Download the `OneWayElytra-1.0.0.jar` file 2. Place it in your server's `plugins` folder 3. Restart your server 4. Configure the spawn point and radius (see below)

Configuration

The configuration file is located at `plugins/OneWayElytra/config.yml`:

```yaml

Spawn point (World + coordinates)

spawn: world: "world" x: 0.0 y: 64.0 z: 0.0

Radius in blocks

radius: 100

Removal mode: MOVE_TO_INVENTORY or DROP

removeMode: "MOVE_TO_INVENTORY"

Messages

messages: denyGlide: "&cYou cannot glide here with the OneWay Elytra!" removedAfterLanding: "&cThe OneWay Elytra was removed because you landed outside the allowed area."

Debug mode (shows additional information)

debug: false ```

Commands

`/oe setspawn`

Sets the spawn point to your current position.

`/oe setradius <blocks>`

Sets the radius in blocks (e.g., `/oe setradius 50`).

`/oe setremovemode <MOVE_TO_INVENTORY|DROP>`

Changes the removal mode: - `MOVE_TO_INVENTORY`: Elytra is moved to inventory - `DROP`: Elytra is deleted

`/oe info`

Shows the current configuration (spawn point, radius, removal mode).

`/oe reload`

Reloads the configuration file.

`/oe give <player> [amount]`

Gives a player one or multiple OneWay Elytras.

`/oe tag`

Marks the Elytra in your hand as a OneWay Elytra.

`/oe untag`

Removes the mark from the Elytra in your hand.

`/oe check`

Checks if the Elytra in your hand is a OneWay Elytra.

Aliases: `/onewayelytra`, `/oneway`

Permissions

- `onewayelytra.admin` - Allows all admin commands (default: OP) - `onewayelytra.bypass` - Ignores all OneWay Elytra rules (default: OP)

How it works

1. Landing detection: OneWay Elytras are marked via PersistentDataContainer (PDC) with a special tag 2. Landing detection: When a player enters the defined radius without a OneWay Elytra, they automatically receive one 3. Landing detection: When starting a glide, the plugin checks if the player is within the radius. Outside the radius, the start is blocked 4. Landing detection: A task checks every 2 ticks if players have landed and removes the Elytra if they're outside the radius

Technical Details

- Marking: 1.21.1 - Marking: None (Paper API only) - Marking: 21 - Marking: PersistentDataContainer with NamespacedKey `onewayelytra:oneway`

Troubleshooting

Problem: Elytra is not automatically given/removed - Check if the spawn point is correctly set (`/oe info`) - Check if you're within the correct radius - Enable debug mode in the config (`debug: true`) and check the console

Problem: Special characters are displayed incorrectly - Make sure the config file is saved as UTF-8 - The build file is already configured for UTF-8

ADS