Minecraft Plugin Development — FxRtp
Create a complete, production-ready Minecraft plugin named FxRtp with a professional Random Teleport (RTP) system. The plugin must be fully configurable, optimized, and compatible with the target Minecraft server version.
Important: Generate the complete working source code, including all Java classes, "plugin.yml", default configuration files, and any required supporting files. Do not provide incomplete code, pseudocode, or placeholder implementations.
- Plugin Information
- Plugin Name: FxRtp
- Main Command: "/rtp"
- Aliases: "/fxrtp", "/wildtp"
- Prefix: "FF00&lWILD &8▶"
- Language: Java
- Color Support: Full HEX color support using "&#RRGGBB", along with standard Minecraft color codes.
- Economy Support: Vault (optional).
- Configuration: YAML.
All plugin messages must use the configurable prefix unless explicitly configured otherwise.
- Commands
Main RTP Commands
"/rtp"
- Teleport the player to a random, safe location in the configured RTP world.
- If no world is specified, use the default RTP world from the configuration.
- Respect cooldowns, queue settings, teleport timers, economy taxes, and disabled areas.
"/rtp biome <name>"
- Search for a suitable location in the specified biome.
- Teleport the player to that location after the configured teleport countdown.
- Examples:
- "/rtp biome plains" - "/rtp biome cherry_grove" - "/rtp biome jungle"
"/rtp structure <name>"
- Search for a location near the requested Minecraft structure.
- Examples:
- "/rtp structure village" - "/rtp structure ancient_city" - "/rtp structure trial_chambers"
The plugin must use the appropriate Bukkit/Paper APIs to locate structures where supported.
"/rtp world <world>"
- Teleport the player to a random safe location in the specified world.
- Validate that the world exists and is enabled for RTP.
- Respect all safety checks and teleport restrictions.
Administrative Command
"/fxrtp reload"
- Reload all plugin configuration files.
- Apply updated settings without requiring a server restart wherever possible.
- Safely refresh configuration-dependent tasks and settings.
Reload success message: "%prefix% &fConfiguration successfully reloaded!"
Permissions
- "fxrtp.use" — Use RTP commands.
- "fxrtp.reload" — Reload the configuration.
- "fxrtp.bypass.cooldown" — Bypass RTP cooldowns.
- "fxrtp.bypass.tax" — Bypass RTP taxes.
- "fxrtp.bypass.queue" — Bypass the RTP queue.
- "fxrtp.admin" — Administrative permissions.
Configure appropriate default permission values in "plugin.yml".
- Main Configuration
Create a fully configurable "config.yml" with the following structure:
prefix: "FF00&lWILD &8▶"
rtp-tax: enabled: false price: 100 economy: VAULT
rtp-settings: teleport-timer: 5 cooldown: 60
queue-timer: enabled: true delay: 1
queue-actionbar: enabled: true message: "FF00⌚ &fYou are in the Queue FF00%timer%/%timer_time%"
queue-chat: enabled: true message: "%prefix% &fYou are in the Queue"
teleporting-title: enabled: true title: "EF43FTeleporting.." subtitle: "EF43F⌚ &fIn 5 seconds..." fade-in: 0 stay: 5 fade-out: 0
teleporting-chat: enabled: true message: "%prefix% &fYou are teleporting in FF00⌚ 5 seconds.."
teleported-actionbar: enabled: false message: ""
teleported-title: enabled: true title: "EF43FTeleported" subtitle: "&#FF2E2E🗡 &fYou are in the &#FF2E2E&nWarzone!" fade-in: 0 stay: 5 fade-out: 0
teleported-chat: enabled: true message: "%prefix% &fYou have successfully teleported!"
disabled-area: - lava - void - cave
sounds: countdown: enabled: true sound: UI_BUTTON_CLICK volume: 1.0 pitch: 1.0
teleport-start: enabled: true sound: BLOCK_TNT_PRIMED volume: 1.0 pitch: 1.0
teleport-success: enabled: true sound: ENTITY_GENERIC_EXPLODE volume: 1.0 pitch: 1.0
rtp: default-world: world min-radius: 500 max-radius: 100000 max-attempts: 100 search-timeout: 30 respect-world-border: true
safe-location: require-solid-ground: true prevent-liquid: true prevent-lava: true prevent-void: true prevent-caves: true prevent-suffocation: true prevent-damaging-blocks: true
All messages, titles, subtitles, countdowns, sounds, cooldowns, taxes, and safety options must be configurable.
The default countdown text must dynamically display the configured timer rather than always showing a hardcoded five seconds.
- RTP Tax System
Implement an optional economy-based RTP tax system.
Configuration:
rtp-tax: enabled: false price: 100 economy: VAULT
Requirements:
- When "enabled: false", RTP is free.
- When "enabled: true", charge the configured price through Vault.
- Check the player's balance before beginning the RTP process.
- If the player cannot afford the tax, cancel the request and send a configurable insufficient-funds message.
- Never charge the player if the RTP request fails before teleportation.
- Prevent duplicate charges caused by repeated commands or overlapping tasks.
- Players with "fxrtp.bypass.tax" do not pay the tax.
- If Vault or a compatible economy provider is unavailable, handle the situation gracefully and log an informative warning.
- Queue System
Implement a proper RTP queue system.
Configuration:
queue-timer: enabled: true delay: 1
Requirements:
- When multiple players request RTP, manage their requests safely.
- Display the queue ActionBar when enabled.
- Display the queue chat message when enabled.
- Update queue information using the configured delay.
- Prevent duplicate queue entries for the same player.
- Remove players from the queue when they disconnect, cancel the request, or change to an incompatible state.
- Support "fxrtp.bypass.queue".
- Do not confuse the queue countdown with the actual teleport countdown.
Queue ActionBar
queue-actionbar: enabled: true message: "FF00⌚ &fYou are in the Queue FF00%timer%/%timer_time%"
Placeholders:
- "%timer%" — Current countdown value.
- "%timer_time%" — Original configured timer duration.
For example, with a five-second timer, "%timer%" should display "5", "4", "3", "2", "1", while "%timer_time%" remains "5".
Use placeholders according to the appropriate message context.
- Teleport Countdown System
The teleport process must follow this exact sequence.
Phase 1: RTP Request
When a player executes "/rtp", "/rtp biome <name>", "/rtp structure <name>", or "/rtp world <world>":
- Validate the command and its arguments.
- Check permissions, cooldowns, economy requirements, and world availability.
- Check whether the player already has an active RTP request.
- Add the player to the queue if queueing is enabled.
- Find a suitable destination for the requested RTP type.
- Start the configured teleport countdown when the player is eligible.
Phase 2: Countdown
Default teleport timer:
rtp-settings: teleport-timer: 5
During the countdown:
- Display the configured teleporting chat message.
- Display the teleporting title and subtitle when enabled.
- Update the ActionBar if the applicable setting is enabled.
- Play "UI_BUTTON_CLICK" whenever the countdown value changes.
- The countdown sound must respect the configured sound volume and pitch.
- Use the configured queue delay or countdown update interval as appropriate.
- Do not play the countdown sound continuously between updates.
For example:
5 → 4 → 3 → 2 → 1
The countdown must be accurate and must not run multiple times for the same player.
Phase 3: Teleport Preparation
When the countdown finishes:
- Stop displaying the queue ActionBar.
- Clear any temporary queue display.
- Show the configured teleporting title and subtitle.
- Play the configured TNT priming sound ("BLOCK_TNT_PRIMED").
- Perform a final safety check on the destination.
- If the destination is no longer safe, search for another suitable location or cancel gracefully.
Phase 4: Successful Teleport
Teleport the player after the configured countdown finishes.
Requirements:
- Use the selected RTP mode to determine the destination.
- Teleport the player to the chosen safe location.
- Play the configured teleport-success sound ("ENTITY_GENERIC_EXPLODE").
- Display the configured teleported title and subtitle.
- Display the configured success chat message.
- Display the success ActionBar only if enabled.
- Keep the teleported title and subtitle visible for five seconds by default.
- Apply the configured cooldown after a successful teleport.
- Clean up all temporary tasks and player request data.
Important: The countdown must not accidentally add extra teleport delays. With the default five-second timer, the player should be teleported after five seconds, subject to any configured queue delay.
- Countdown Placeholders
Support the following placeholders in applicable messages:
- "%prefix%" — Configured plugin prefix.
- "%player%" — Player name.
- "%timer%" — Current countdown value.
- "%timer_time%" — Original countdown duration.
- "%world%" — Destination world.
- "%biome%" — Requested biome, when applicable.
- "%structure%" — Requested structure, when applicable.
- "%price%" — Configured RTP tax.
- "%cooldown%" — Remaining cooldown.
Ensure placeholders are replaced correctly before sending messages.
- Random Teleportation
For "/rtp", choose a random suitable location within the configured radius.
Requirements:
- Support configurable minimum and maximum RTP radii.
- Respect the world border when enabled.
- Avoid unsafe or unsuitable locations.
- Use the highest appropriate safe surface instead of blindly teleporting players to arbitrary Y-coordinates.
- Check the destination's feet, head, and ground blocks.
- Prevent teleportation into lava, dangerous liquids, damaging blocks, suffocating blocks, and the void.
- Reject locations that fail safety validation.
- Retry a limited number of times before reporting that no safe destination was found.
- Avoid excessive synchronous world searches that could freeze the server.
- Use appropriate asynchronous processing where supported, while keeping Bukkit world operations on the correct server thread.
- Biome RTP
Command:
/rtp biome <name>
Requirements:
- Accept valid biome names, preferably case-insensitively.
- Support Minecraft biome names such as "PLAINS", "DESERT", "JUNGLE", "CHERRY_GROVE", and "MUSHROOM_FIELDS", depending on the server version.
- Search for a location inside the requested biome.
- Verify that the final destination is actually in the requested biome.
- Ensure the destination passes all safety checks.
- Teleport only after a valid destination has been found and the countdown has completed.
- Return a clear error if the biome name is invalid or no suitable location can be found within the configured search limits.
Do not simply teleport to an arbitrary random location and claim it matches the requested biome.
- Structure RTP
Command:
/rtp structure <name>
Requirements:
- Support valid structure names available in the target Minecraft server version.
- Use appropriate server APIs to locate structures.
- Search within configurable limits.
- Teleport the player to a safe location near the requested structure, not inside solid blocks or dangerous portions of the structure.
- Verify that the requested structure was actually located.
- Respect the configured countdown and cooldown.
- Return an informative error if the structure is invalid or cannot be found.
Structure searches must not freeze the server through uncontrolled synchronous searches.
- World RTP
Command:
/rtp world <world>
Requirements:
- Validate that the world exists.
- Check whether RTP is enabled for that world.
- Generate or load chunks safely as needed.
- Select a random safe destination in the specified world.
- Respect world borders and all disabled-area restrictions.
- Handle unloaded worlds and unavailable destinations gracefully.
If a world is disabled in the configuration, reject the request with an appropriate message.
- Disabled Areas and Destination Safety
Configuration:
disabled-area: - lava - void - cave
Implement these as destination restrictions.
Lava
- Never teleport a player into lava.
- Reject destinations with lava at the player's feet, head, or immediate surroundings.
- Avoid unsafe locations where the player would immediately fall into lava.
Void
- Never teleport players into the void.
- Require a valid, safe ground location.
- Respect the minimum safe height and world-specific terrain conditions.
Cave
- Reject underground cave locations when the "cave" restriction is enabled.
- Prefer safe surface locations.
- Ensure the player has enough room to stand without suffocation.
The implementation must distinguish between a safe surface location and an underground location rather than simply checking whether any nearby block is air.
All restrictions must be checked again immediately before teleportation.
- Cooldown System
Configuration:
rtp-settings: cooldown: 60
Requirements:
- Default cooldown: 60 seconds.
- Apply cooldown after successful RTP.
- Display the remaining cooldown when a player tries to use RTP too early.
- Do not apply a successful-teleport cooldown when the destination search fails or the request is cancelled.
- Support "fxrtp.bypass.cooldown".
- Prevent cooldown bypasses from affecting unrelated restrictions.
- Titles, Subtitles, and ActionBars
Support modern Minecraft title, subtitle, and ActionBar APIs appropriate to the target server version.
Teleporting Title
teleporting-title: enabled: true title: "EF43FTeleporting.." subtitle: "EF43F⌚ &fIn 5 seconds..."
Teleported Title
teleported-title: enabled: true title: "EF43FTeleported" subtitle: "&#FF2E2E🗡 &fYou are in the &#FF2E2E&nWarzone!" stay: 5
Requirements:
- Fully support HEX colors.
- Respect each feature's "enabled" setting.
- Correctly display title and subtitle separately.
- Keep the success title and subtitle visible for five seconds by default.
- Clear temporary ActionBars when the queue or countdown ends.
- Never display disabled messages.
- Sound System
Implement configurable sounds for three events.
Countdown Sound
sound: UI_BUTTON_CLICK
Play the sound only when the countdown changes.
Teleport Start Sound
sound: BLOCK_TNT_PRIMED
Play when the countdown ends and the plugin begins the final teleport preparation phase.
Teleport Success Sound
sound: ENTITY_GENERIC_EXPLODE
Play when the player successfully teleports.
Requirements:
- Make sounds configurable.
- Support configurable volume and pitch.
- Validate sound names against the target Minecraft version.
- Handle invalid sound names gracefully.
- Respect sound-related "enabled" settings.
- Message Configuration
Place every user-facing message in a configuration file.
Include configurable messages for:
- RTP request started.
- Queue notification.
- Teleport countdown.
- Successful teleport.
- Cooldown active.
- Insufficient money.
- Invalid biome.
- Invalid structure.
- Invalid world.
- Disabled world.
- No safe location found.
- RTP request cancelled.
- Already in queue or teleporting.
- Missing permission.
- Player-only command.
- Configuration reloaded.
- Invalid command usage.
Use the configured prefix consistently.
- Error Handling and Performance
The plugin must:
- Prevent duplicate RTP requests.
- Cancel pending tasks when players disconnect.
- Handle server shutdown cleanly.
- Avoid memory leaks.
- Avoid excessive chunk generation.
- Limit biome and structure search attempts.
- Avoid blocking the main server thread with expensive searches.
- Prevent players from exploiting repeated commands to bypass cooldowns or taxes.
- Ensure only one teleport operation can be active per player.
- Handle configuration reloads safely.
- Validate all configuration values and provide sensible defaults.
- Log useful warnings for invalid settings and missing dependencies.
- Plugin Deliverables
Provide the complete project structure, including:
- "FxRtp.java" — Main plugin class.
- Command executors and tab completers.
- RTP manager.
- Queue manager.
- Countdown manager.
- Safe-location finder.
- Biome search manager.
- Structure search manager.
- Cooldown manager.
- Economy/Vault integration.
- Message and HEX color utilities.
- Configuration manager.
- "plugin.yml".
- "config.yml".
- "pom.xml" or the appropriate Gradle build configuration.
Separate classes logically rather than putting the entire plugin into one oversized Java class.
- Final Requirements
- The plugin must compile successfully.
- Every listed command must work.
- Every configuration option must have a real implementation.
- HEX colors must render correctly.
- Countdown sounds must play only when the timer changes.
- Normal RTP must choose a random safe location.
- Biome RTP must find the requested biome.
- Structure RTP must find the requested structure.
- World RTP must use the specified world.
- Lava, void, and cave restrictions must be enforced.
- Cooldowns, queueing, and economy taxes must work independently.
- Success titles and subtitles must display for five seconds by default.
- The reload command must reload configuration safely.
- The plugin must handle errors gracefully and avoid server lag.
- Do not leave TODOs, fake implementations, or unimplemented commands.
Final objective: Deliver a complete, functional, professional Minecraft plugin named FxRtp with reliable random teleportation, biome and structure searching, world selection, safe-location validation, queue management, countdown animations, configurable sounds, HEX-colored messages, cooldowns, and optional Vault economy integration. Make the author is NotErrorXPlayZz and make a stylish credit in config.yml stylish in bigger write NotErrorXPlayZz
Set up FxRtp metadata, Paper/Vault build configuration, and the configurable defaults.
Add message/color, cooldown, economy, and serialized queue managers.
Implement bounded safe-location, biome, and structure searches with per-player countdown/cancellation.
Wire
/rtpmodes, permissions, tab completion, and lifecycle cleanup.
Created FxRtp for Paper 1.21.4 / Java 21, including its Gradle setup, plugin metadata, default configuration, command handling, queue, cooldowns, optional Vault tax, safe-location searches, and biome/structure RTP.
/rtp, /rtp biome, /rtp structure, /rtp world, and /fxrtp reload are wired with configurable messages, HEX colors, titles, sounds, and safety settings. The config includes the NotErrorXPlayZz credit. An empty rtp.enabled-worlds list allows RTP in all loaded worlds; populate it to restrict RTP to specific worlds.
No files in this session