Перейти к содержимому
Mineforgian

LastLocation

A Minecraft Plugin that safes the LastLocation of the Logout. So when they log back in they can do /LastLocation if they are (for example) forced to spawn on the hub. Now they are at their Logout location!

Загрузки
442
Подписчики
1
Обновлён
15 декабря 2025 г.
Лицензия
All-Rights-Reserved

Опубликован 13 декабря 2025 г.

LastLocation is a lightweight, safe, and modern Paper plugin that stores a player’s last logout location and allows them to teleport back to it using /lastlocation.

Designed for Paper 1.20.10+ / 1.21+, built with JDK 21, and focused on performance, safety, and data integrity.


✨ Core Features

🚪 Last Logout Location

  • Stores only the logout location
  • Does NOT store death locations
  • Supports server restart / shutdown
  • Default FILE storage (one .yml per player)
  • Ready for SQLite / MySQL

⏱️ Save After X Seconds Online

  • Logout location is saved only after a player has been online for X seconds
  • Fully configurable
  • Player receives an in-game message once saving becomes active
  • Supports Essentials-style color codes (&)

Example:

save:
  min-online-seconds: 10
  ready-message: "&aYour logout location is now being saved."

🧠 Safe Teleport System

Never teleports players into dangerous blocks such as:

Lava 🔥

Cactus 🌵

Powder Snow ❄️

Portal blocks 🌀

Other configured hazards

Checks:

Feet & head are passable

Solid ground below the player

No dangerous blocks nearby

Performance capped (max checks per teleport)

🛟 Rescue / Anti-Suffocation System

If a player somehow still ends up in danger:

The plugin automatically searches for a safe location within ±10 blocks

Rescue triggers on suffocation damage

Rescue is active for a short time after using /lastlocation

⚔️ PvP / PvE Combat Cooldown

/lastlocation is blocked while the player is in combat

Combat includes:

PvP

PvE

Projectiles

Damage events that are cancelled by other plugins

Cooldown behavior:

Resets every time the player hits or gets hit

No spam messages while in combat

Message is shown only when the command is used

Example:


combat:
  cooldown-seconds: 15

🔁 Automatic Data Migration (No Data Loss)

Automatically migrates data from:

Old locations.yml

Old plugins/LastLocation/Data/*.yml

Also supports data/ (lowercase)

Creates automatic backups

Migration runs only once

Clear console summary:

Successfully migrated players

Skipped entries (missing world, invalid UUID, missing data)

🧩 Automatic Config Rebuild on Updates

Detects when a new plugin version is installed

Automatically:

Backs up the old config

Rebuilds the config using new defaults

Preserves all existing values

No manual config reset required

💾 Storage & Performance

FILE storage (default):

One .yml file per player

Lazy loading

Very low RAM usage

Ready for:

SQLite

MySQL

Async IO where possible

Hard performance caps to prevent lag

🧾 Commands

Command Description /lastlocation Teleport to your last logout location /lastlocation reload Reload the config (admin only)

🔐 Permissions

lastlocation.use:
  default: true

lastlocation.admin:
  default: op

⚙️ Compatibility

✅ Paper 1.20.10+

✅ Paper 1.21.x

✅ Java / JDK 21

❌ Not tested on Spigot / Bukkit

📦 Installation

Place LastLocation-x.x.x.jar into your /plugins folder

Start or restart the server

Done! 🎉

❤️ Design Philosophy Safety first

Never unexpected teleports

Minimal RAM usage

No data loss on updates

Production-ready defaults

Ченджлог

2.3.2Релиз1.21.9, 1.21.10, 1.21.11 · 15 декабря 2025 г.

Bug Fix

2.0.0Релиз1.21.9, 1.21.10, 1.21.11 · 13 декабря 2025 г.
# LastLocation

**LastLocation** is a lightweight, RAM-efficient **Paper** plugin that allows players to safely return to their **last logout location** — never their death location — with advanced safety, performance caps, and flexible storage options.

Built for **modern Paper servers (1.20+)** using **Java 21**.

---

## ✨ Features

### 📍 Logout Location Tracking
- Saves **only the player’s logout location**
- **Death locations are never saved**
- Extra safeguard: if a player logs out while dead, no location is stored

---

### 🚀 `/lastlocation` Command
- Teleports the player to their last saved logout location
- Optional reload command for admins
- Permission-based access

---

### 🛡️ Advanced Safe Teleport System
- Prevents teleporting:
  - Inside solid blocks (anti-suffocation)
  - Into liquids
  - Onto or into dangerous blocks
- Automatically centers the player in the block to avoid edge clipping

---

### ☠️ Hazard Protection (Fully Configurable)

#### Hard Hazards
Blocks that are **never allowed** at feet, head, or ground:
- Lava, fire, cactus, magma blocks, campfires
- Sweet berry bushes, wither roses, powder snow
- Nether / End portals and gateways
- Fully configurable via `config.yml`

#### Nearby Hazards (Buffer Zone)
- Prevents teleporting **too close** to hazards
- Configurable buffer radius (3×3, 5×5, etc.)
- Optional avoidance of nearby liquids (water / lava)
- Separate material list for fine-grained control

---

### 🛟 Automatic Anti-Suffocation Rescue
- If a player starts **suffocating after teleport**:
  - Damage is cancelled
  - Player is automatically teleported to a safe nearby spot
- Rescue search is centered around the original logout location
- Additional post-teleport safety checks handle edge cases

---

### ⚡ Performance-Safe by Design
- Hard performance caps prevent excessive block scanning
- Limits on:
  - Safe location candidates
  - Nearby hazard block checks
  - Rescue search attempts
- Safe for large servers and aggressive configurations

---

### 🧠 Extremely RAM Efficient
- No player locations cached in memory
- Locations are loaded only when needed
- Rescue data exists only briefly after `/lastlocation`
- Scales cleanly with player count

---

### 💾 Flexible Storage Options
Choose what fits your server best:

- **FILE** – One small file per player (simple & efficient)
- **SQLite** – Single local database file
- **MySQL / MariaDB** – Ideal for multi-server networks

Storage type can be changed via config.

---

### 🔁 Reload Support
- `/lastlocation reload`
- Reloads config, hazard lists, and performance settings
- No server restart required

---

## 📜 Commands

| Command | Description |
|------|-------------|
| `/lastlocation` | Teleport to last logout location |
| `/lastlocation reload` | Reload configuration |

---

## 🔐 Permissions

| Permission | Description | Default |
|---------|-------------|---------|
| `lastlocation.use` | Use `/lastlocation` | `true` |
| `lastlocation.admin` | Reload config | `op` |

---

## ⚙️ Configuration Explanation

### 🗄️ Storage
```yml
storage:
  type: "FILE"

FILE – Per-player files (default)
SQLITE – Single local database
MYSQL – Remote database for networks

🚀 Teleport Safety
teleport:
  safe-teleport: true


Enables all safety logic. Highly recommended.

📐 Safe Location Search
teleport:
  safe-search:
    max-radius: 6
    max-up: 6
    max-down: 6


Controls how far the plugin searches for a safe teleport spot.

🛟 Auto-Rescue
teleport:
  rescue:
    enabled: true
    window-seconds: 8
    rescue-radius: 10
    rescue-max-up: 10
    rescue-max-down: 10


Automatically rescues players if suffocation occurs shortly after teleport.

☠️ Hazard Control
Hard Hazards
teleport:
  hazards:
    override-defaults: false
    materials:
      - LAVA
      - FIRE
      - CACTUS


Blocks that are never allowed at feet, head, or ground.

Nearby Hazards (Buffer Zone)
teleport:
  hazards:
    nearby:
      buffer-radius: 1
      avoid-liquids-nearby: false
      override-defaults: false
      materials:
        - WATER
        - LAVA


Prevents teleporting too close to dangerous blocks.

⚡ Performance Limits
teleport:
  performance:
    max-candidates: 900
    max-nearby-block-checks: 300
    rescue-max-candidates: 1600


Hard caps that protect server performance.

💬 Messages
messages:
  teleported: "&aTeleported to your last logout location."
  no-location: "&cNo saved logout location found."


Supports color codes using &.






🧩 Compatibility

Platform: Paper

Minecraft: 1.20+

Java: 21

Комментарии

Загружаем…