Skip to content

js-scripts-fivem/js-serverutils

Repository files navigation

ServerUtils — Essentials-style commands for Fabric

Lightweight, server-focused utilities that add essentials-style commands: homes, TPA, RTP, and back — with configurable warmups, cooldowns, safe teleports, and LuckPerms integration.

  • Minecraft: 1.21.10 (Java Edition)
  • Fabric Loader: 0.17.3+
  • Requires: Fabric API (matching 1.21.10)
  • Server-only mod (no client required)

Highlights

  • Multiple homes per player with per-rank limits
  • /home warmup (default 5s), per-second chime, cancel-on-movement, warp sound
  • TPA requests with accept/deny
  • RTP: border-aware, safe-location scan, optional chunk-loading, warmup + rank-based cooldown, optional hard max radius
  • /back to previous location (cross-dimension)
  • LuckPerms support for command access, home limits, and RTP cooldowns
  • Simple JSON config at config/serverutils.json

Commands

  • /sethome [name] — Set a home (default “home” if omitted)
  • /home [name] — Teleport to a home; no argument lists your homes (warmup + chime + cancel-on-move)
  • /homes — List your homes
  • /delhome — Delete a home
  • /tpa — Send a teleport request
  • /tpaccept — Accept the latest TPA request
  • /tpdeny — Deny the latest TPA request
  • /rtp — Random safe teleport (border-aware, warmup + cooldown)
  • /back — Return to your previous location

Notes

  • Default warmups: /home 5s; /rtp 3s (both configurable)
  • RTP can use a hard world radius cap (e.g., for a 50k×50k world, set 25,000)

LuckPerms Integration

  • Use LuckPerms to grant command access, set per-rank home limits, adjust RTP cooldowns, or bypass cooldowns

Permission nodes (grant/deny per group/user)

  • serverutils.command.home
  • serverutils.command.sethome
  • serverutils.command.delhome
  • serverutils.command.homes
  • serverutils.command.back
  • serverutils.command.tpa
  • serverutils.command.tpaccept
  • serverutils.command.tpdeny
  • serverutils.command.rtp
  • serverutils.homes.unlimited
  • serverutils.homes.max.X (X = 1..100)
  • serverutils.rtp.bypasscooldown
  • serverutils.rtp.cooldown.N (N = 0..3600 seconds)

LuckPerms Meta keys (add in “Meta”, not “Permissions”)

  • serverutils.homes.max =
  • serverutils.rtp.cooldown =

Examples (typical setup)

  • Default group:
    • Meta: serverutils.homes.max = 3
    • Meta: serverutils.rtp.cooldown = 60
  • VIP group:
    • Meta: serverutils.homes.max = 10
    • Meta: serverutils.rtp.cooldown = 15
  • Staff:
    • Permission: serverutils.homes.unlimited = true
    • Permission: serverutils.rtp.bypasscooldown = true

Features and Behavior

Homes:

  • Multiple homes per player, per-rank limits via nodes or LP meta
  • Warmup (default 5s), per-second chime, cancel if the player moves, warp sound on arrival

TPA:

  • /tpa, /tpaccept, /tpdeny with timeout (default 60s)

RTP:

  • Safe search (no fluid, solid support, 2-block headroom, hazard checks)
  • Respects world border and optional hard max radius
  • Optional chunk-load so heightmap works off-road
  • Warmup (default 3s) + cooldown via LP meta or nodes, warp sound on arrival

Back:

  • Returns to previous location (cross-dimension).

Configuration (config/serverutils.json)

{
  // Maximum number of homes a player can set by default (if not overridden by LuckPerms)
  "defaultMaxHomes": 3,

  // If true, LuckPerms meta key "serverutils.homes.max" overrides defaultMaxHomes per player/group
  "useLuckPermsMetaForMaxHomes": true,

  // Upper bound for scanning permission tiers "serverutils.homes.max.X" (X=1..permissionMaxHomesScanCeil)
  "permissionMaxHomesScanCeil": 100,

  // If true, players (or groups) with "serverutils.homes.unlimited" can set unlimited homes
  "allowUnlimitedHomesPermission": true,

  // Seconds before a /tpa request expires if not accepted/denied
  "tpaTimeoutSeconds": 60,

  // RTP: Minimum distance from center/border center for random teleport sampling (in blocks)
  "rtpMinDistance": 100,

  // RTP: Maximum distance for sampling (in blocks); may be further clamped by world border/hard max radius
  "rtpMaxDistance": 5000,

  // RTP: How many random attempts to find a safe spot before giving up
  "rtpMaxAttempts": 12,

  // If true, RTP sampling respects the world border and stays within it (minus margin)
  "rtpRespectWorldBorder": true,

  // Blocks to stay inside the world border when sampling RTP positions
  "rtpWorldBorderMargin": 16,

  // Dimensions where RTP is allowed; others are blocked
  "rtpAllowedWorlds": [
    "minecraft:overworld"
  ]
}

About

Fabric Utilities Plugin with simple commands for your server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published