promotional bannermobile promotional banner
premium banner
TioPvPTime turns PVP on or off on your server based on in-game day/night time (per world). Players see a small corner icon when PVP is on or off on configured worlds.

Description

What this mod does

TioPvPTime controls whether players can fight each other (PVP) in the worlds you choose. It does not use real-world clocks—it uses the game’s own time in each world (the same time you change with /time set and that you see as day and night).

  • Inside the hours you set → PVP is on.
  • Outside those hours → PVP is off.

Each world can have its own schedule. For example, your main survival map might allow PVP only at night (e.g. from 19:00 to 06:00 in-game), while an arena world might allow PVP only during a short afternoon window.

Worlds you do not list are untouched: no automatic PVP switching and no PVP icon from this mod.


What players see

  • On listed worlds, a corner icon shows whether PVP is currently on or off for that world.
  • When PVP turns on or off because the in-game time crossed your window, everyone in that world can get a big on-screen title (optional—you can turn that off in config).
  • /tpvp or /pvp on a listed world toggles whether they see the corner icon (it does not change server PVP rules—only their display). If they are in a world that is not listed, they get a short message explaining that this mod only applies to certain worlds.

How to set it up (server admin)

  1. Install the mod on the server and make sure players also install the same mod (it includes the images for the icon).
  2. Start the server once. The mod creates a config.json file in its plugin data folder.
  3. Open config.json and edit the worlds list:
    • name — the exact name of the world (must match how the server names that world).
    • pvpActiveStart and pvpActiveEnd — times in HH:mm (24-hour) when PVP should be allowed, using that world’s in-game clock.
  4. If the start time is later than the end time (e.g. 19:00 to 06:00), the mod treats that as overnight: PVP is on from evening through midnight until morning.
  5. Save the file. Either restart the server or run /tpvp reload (or /pvp reload) from the server console to apply changes without a full restart.

You can change how often the server checks the time (checkIntervalSeconds). Lower values react faster; higher values are lighter on the server.


Commands

Who Command What happens
Player /tpvp or /pvp On a listed world: turns the PVP icon on or off on your screen (chat confirms). Does not change actual PVP rules. In other worlds: explains which worlds use the mod.
Server console /tpvp reload or /pvp reload Reloads the config from disk and updates schedules and icons. No special permission needed.
Player /tpvp reload / /pvp reload Same as console reload, but usually only for staff—give them the tio.tiopvptime.command.tpvp.reload permission (or tio.tiopvptime.*).

Optional: other mods that add a custom HUD

If you use MultipleHUD (or run into errors about custom UI / HUD when several mods try to show things at once), open config.json and set useMultipleHud to true. That makes this mod register its icon in a dedicated slot instead of taking over the whole HUD.


Customizing messages

All chat lines and title texts can be edited under translation in config.json (for example the messages when the player shows or hides the icon, wrong-world hint, and reload success/error). You can translate them to any language you like.


TioPvPTime — Server config.json Setup Guide (Admins)

This guide explains how to use config.json to control PVP per world using game-time schedules, customize messages, and adjust the HUD/icon behavior.

1. What the mod does (practical behavior)

  • The server turns PVP on or off per world within in-game time windows (HH:mm).
  • The window is defined in worlds, and can be different for each world.
  • On configured worlds, a small icon shows PVP ON/OFF.
  • The player command /tpvp (and /pvp) toggles the icon only for that player’s screen (it does not change the world’s PVP rules).
  • Admins can apply changes without restarting using /tpvp reload / /pvp reload.

2. Where config.json is created

On the first server run, the plugin automatically creates config.json inside the mod’s data folder.

3. Main configuration: worlds

The core of the setup is the list:

"worlds": [
  { "name": "survival", "pvpActiveStart": "19:00", "pvpActiveEnd": "06:00" }
]

3.1. Fields

  • name
    • Exact world name (must match the world name on your server).
  • pvpActiveStart and pvpActiveEnd
    • Times in 24h format: HH:mm.
    • Defines when PVP is ON for that world.

3.2. Time windows that cross midnight

If pvpActiveStart is later than pvpActiveEnd (example: 19:0006:00):

  • The mod treats it as an overnight window.
  • Example: PVP stays ON from 19:00 to 24:00, and continues ON from 00:00 to 06:00.

3.3. Worlds that are not listed

If a world is not included in the worlds array:

  • The mod does not change that world’s PVP behavior.
  • The mod’s PVP icon does not appear on worlds outside the list.

4. Full example (multiple worlds)

{
  "worlds": [
    { "name": "survival", "pvpActiveStart": "19:00", "pvpActiveEnd": "06:00" },
    { "name": "arena", "pvpActiveStart": "12:00", "pvpActiveEnd": "14:00" },
    { "name": "default", "pvpActiveStart": "00:00", "pvpActiveEnd": "23:59" }
  ],
  "useMultipleHud": false,
  "showPvpStatusEventTitle": true,
  "checkIntervalSeconds": 30,
  "pvpIconHorizontalAlign": "left",
  "pvpIconTopOffsetPx": 132,
  "translation": {
    "pvpEnabledMessage": "PVP is enabled, be careful!",
    "pvpDisabledMessage": "PVP is disabled, enjoy exploring!",
    "commandWrongWorldMessage": "This mod’s PVP schedule only applies to these worlds: {world}.",
    "commandPvpIconShownMessage": "PVP icon enabled.",
    "commandPvpIconHiddenMessage": "PVP icon disabled. Use /tpvp again to show it.",
    "commandReloadSuccessMessage": "TioPvPTime: configuration reloaded.",
    "commandReloadErrorMessage": "TioPvPTime: error reading config.json.",
    "commandReloadPermissionDeniedMessage": "You don’t have permission to reload TioPvPTime configuration.",
    "pvpStatusTitleMessage": "TioPvPTime",
    "pvpStatusSubtitleEnabledMessage": "PVP Enabled",
    "pvpStatusSubtitleDisabledMessage": "PVP Disabled"
  }
}

5. config.json options

checkIntervalSeconds

  • How often (in seconds) the server re-checks the in-game time and updates PVP.
  • Recommendation: values like 30 or 60 are usually enough.
  • The mod internally clamps the range.

useMultipleHud

  • false (default): this mod uses its icon HUD directly.
  • true: recommended if you use MultipleHUD (or any other mod that also modifies HUD using Custom UI).

If you see conflicts like “Failed to apply CustomUI HUD commands” (client kick/error), set useMultipleHud to true.

showPvpStatusEventTitle

  • true: when world PVP toggles (enter/exit your time window), players in that world can receive a native title/subtitle.
  • false: disables only that title/subtitle; the icon and the rest of the behavior still work.

pvpIconHorizontalAlign

  • Where the PVP icon is anchored horizontally on the screen.
  • Valid values: left or right.
  • Default: left.

pvpIconTopOffsetPx

  • Vertical offset in pixels from the top of the screen to the PVP icon anchor.
  • Default: 132 (matches the current “move down ~120px” behavior).
  • The mod clamps the value to a safe range.

6. translation (messages)

You can customize chat text and title messages.

6.1. Important messages

  • commandWrongWorldMessage
    • Sent when a player runs /tpvp / /pvp in a world not included in worlds.
    • Uses {world} placeholder (a list of configured world names).
  • commandPvpIconShownMessage / commandPvpIconHiddenMessage
    • Sent to the player when toggling the icon with /tpvp / /pvp.
    • Important: this is about the icon on the player’s screen, not the world’s actual PVP rules.
  • commandReloadSuccessMessage / commandReloadErrorMessage
    • Messages when someone reloads the config.
  • commandReloadPermissionDeniedMessage
    • Shown when the player does not have permission.

6.2. Legacy messages

  • pvpEnabledMessage and pvpDisabledMessage exist for compatibility. The main /tpvp behavior is now the icon toggle.

7. Reload (without restarting)

  • Admin console: /tpvp reload or /pvp reload
  • Player (with permission): tio.tiopvptime.command.tpvp.reload

After reloading, the mod:

  • re-reads worlds and schedules;
  • updates PVP for listed worlds;
  • synchronizes icons (including removing the icon on worlds that are no longer in config.json).

8. Legacy config migration (if applicable)

If you previously had a config with:

  • worldNames + global times (or a single worldName string),

the mod converts it automatically to the new worlds format when loading.

9. Quick checklist (to avoid problems)

  • Make sure the world name in worlds[].name matches the real server world name exactly.
  • Use times in HH:mm (e.g. 07:30, 19:00).
  • For “night to morning”, use start > end (e.g. 19:0006:00).
  • If HUD conflicts happen, enable useMultipleHud.
  • Run /tpvp reload after editing the file.

Credits

Author: Tio · Optional companion mod: MultipleHUD (Buuz135)