Minecraft RTP Button Plugin Spigot / Paper – Java GOAL Create a Minecraft Spigot/Paper plugin in Java that allows players to randomly teleport by pressing a stone button, while ensuring the player never spawns inside blocks or unsafe locations. RTP TRIGGER RTP is triggered when: Player right-clicks a STONE BUTTON Use: PlayerInteractEvent Ignore all other interactions BASE LOCATION All teleport locations are calculated relative to: Center: X = 0, Y = 100, Z = 0 TELEPORT RANGE Minimum distance from center (X/Z): 1000 blocks Maximum distance from center (X/Z): 9950 blocks Randomize: X and Z Y is calculated automatically from terrain SAFE LOCATION REQUIREMENTS (VERY IMPORTANT) A location is considered SAFE ONLY IF ALL CONDITIONS ARE TRUE: 1️⃣ SOLID GROUND Block below feet must be: Solid Not lava Not fire Not magma Not cactus 2️⃣ FREE SPACE FOR PLAYER Block at feet = AIR Block at head = AIR Block above head = AIR (extra safety) 3️⃣ NO SUFFOCATION Player bounding box must not intersect any blocks Use block checks to guarantee no collision FORBIDDEN BLOCKS Teleport must FAIL if any of these are detected: LAVA FIRE MAGMA_BLOCK CACTUS CAMPFIRE POWDER_SNOW VOID (WATER optional – your choice) RETRY SYSTEM Try up to 15 random positions If location fails safety check: Generate new coordinates If all attempts fail: Cancel teleport Notify player TELEPORT EXECUTION Teleport player: To safe Y level Same world Apply: Short no-fall-damage protection (optional) PLAYER FEEDBACK On success: ✔ Random teleport successful! X: <x> Z: <z> On failure: ✖ Safe location not found. Try again. SAFETY GUARANTEES This plugin MUST guarantee: ❌ Player never spawns inside blocks ❌ Player never suffocates ❌ Player never spawns in lava or void ❌ Player never takes fall damage TECHNICAL REQUIREMENTS Language: Java Platform: Spigot / Paper Bukkit API only Synchronous logic Clean and readable code FINAL EXPECTED RESULT After implementation: ✅ Stone button RTP works ✅ Teleport distance respected ✅ Player never spawns in blocks ✅ Full collision safety ✅ Stable and safe RTP