▶️ ЗАБЕРИ СВОИ 8 ПОДАРКОВ 🎁 ПРИ СОЗДАНИИ СВОЕГО МАЙНКРАФТ СЕРВЕРА
Плагины/SMP PVP MODE
SMP PVP MODE

SMP PVP MODE

This project adds a /duel command to your SMP server, allowing players to start 1v1 arena duels instantly. ——为你的 SMP 服务器添加 /duel 指令,让玩家随时开启 1v1 竞技场决斗。

Оцените первым
85
3

SMP PVP MODE

[英文版本在下方 | The English version is below]

PVP Mod 是一个为 Minecraft SMP 服务器设计的竞技场地 PVP 模组。该模组通过自动化场地管理、装备发放和战斗规则,为服务器管理员提供了完整的竞技场解决方案。

场地管理

模组支持两种场地模式:

生成模式 (Generate) 自动生成临时竞技场地,战斗结束后自动清理,不污染主世界。场地结构固定为三层:基岩层(Y=317)、草方块层(Y=318)、光源层(Y=319),可配置场地尺寸和生成坐标范围。玩家传送位置在光源层上方(Y=319)。

传送模式 (TP) 使用预先建造的竞技场,通过配置传送点实现玩家快速传送。支持多场地并发,自动检测场地占用状态,避免冲突。

装备系统

战斗前自动保存玩家原有装备、生命值和饥饿值,战斗期间发放临时装备,战斗结束后恢复原状态。

支持配置的装备类型:

  • hotbar - 快捷栏(9个格子)
  • inventory - 背包(27个格子)
  • armor - 盔甲(头盔、胸甲、护腿、靴子)
  • offhand - 副手(手持盾牌等)

所有装备都支持附魔配置。

生命饥饿值恢复

传送至竞技场后可自动回满生命值和饥饿值,战斗结束后恢复传送前的状态。此功能可在配置中开启或关闭。

安全机制

  • 战斗期间禁止丢弃装备,防止刷物资
  • 世界边界限制,防止玩家逃跑
  • 玩家数据持久化到磁盘,支持服务器重启后恢复

玩家体验

  • 纯服务端运行,玩家无需安装客户端模组
  • 聊天按钮交互,操作便捷
  • 同意决斗后进入旁观模式,倒计时期间禁止移动
  • 倒计时结束自动切换到战斗模式,可正常移动和攻击
  • 夜视效果,确保场地可见

内置玩法

经典剑斗 (classic)

  • 显示名称: 经典剑斗
  • 描述: 高版本剑斗PVP
  • 场地模式: 生成模式
  • 装备: 钻石剑、铁剑(锋利1)、钻石盔甲全套
  • 游戏模式: 冒险模式
  • 夜视效果: 开启
  • 倒计时: 5秒
  • 回满生命: 开启

配置说明

配置文件位置

服务器根目录/config/pvpmod-config.json

配置结构

每个玩法独立配置,包含以下核心部分:

{
  "玩法ID": {
    "display-name": "显示名称",
    "description": "玩法描述",
    "arena-mode": "场地模式",
    "game-mode": "游戏模式",
    "equipment": { ... },
    "countdown-seconds": 5,
    "give-night-vision": true,
    "refill-health-hunger": true
  }
}

中文配置字段支持

从 v1.0.2 开始,配置文件支持中文字段名,中英文可以混用。以下是支持的中文别名:

中文字段英文字段说明
显示名称display-name玩法显示名称
描述description玩法描述
场地模式arena-mode场地模式(tp/generate)
游戏模式game-mode游戏模式
夜视效果give-night-vision是否开启夜视效果
倒计时countdown-seconds倒计时秒数
回满生命refill-health-hunger是否回满生命和饥饿
装备equipment装备配置
快捷栏hotbar快捷栏(9个格子)
背包inventory背包(27个格子)
盔甲armor盔甲配置
副手offhand副手物品
头盔helmet头盔
胸甲chestplate胸甲
护腿leggings护腿
靴子boots靴子
生成配置generate-config生成模式配置
传送配置tp-config传送模式配置
传送点spawn-points传送点列表
尺寸size场地尺寸
最小坐标min-coordinate最小生成坐标
最大坐标max-coordinate最大生成坐标
物品item物品ID
数量count物品数量
附魔enchantments附魔配置
世界边界world-border世界边界配置
中心Xcenter-x世界边界中心X
中心Zcenter-z世界边界中心Z

注意:物品ID(如 diamond_swordiron_sword)、附魔ID(如 sharpnessprotection)和游戏模式值(如 adventuresurvival)必须使用英文。

中文配置示例

{
  "chinese-example": {
    "显示名称": "中文配置演示",
    "描述": "使用中文配置字段的示例玩法",
    "场地模式": "generate",
    "生成配置": {
      "尺寸": 32,
      "最小坐标": 1000,
      "最大坐标": 5000
    },
    "装备": {
      "快捷栏": {
        "0": { "物品": "iron_sword", "数量": 1, "附魔": { "sharpness": 3 } }
      },
      "盔甲": {
        "头盔": { "物品": "iron_helmet" },
        "胸甲": { "物品": "iron_chestplate" }
      },
      "副手": { "物品": "shield", "数量": 1 }
    },
    "游戏模式": "adventure",
    "夜视效果": true,
    "倒计时": 3,
    "回满生命": true
  }
}

场地模式配置

生成模式

"arena-mode": "generate",
"generate-config": {
  "size": 64,
  "min-coordinate": 1000,
  "max-coordinate": 5000
}

参数说明:

  • size: 场地尺寸,例如64表示64x64的场地
  • min-coordinate: 场地生成的最小坐标
  • max-coordinate: 场地生成的最大坐标

传送模式

"arena-mode": "tp",
"tp-config": {
  "spawn-points": [
    {
      "player1": { "x": 100, "y": 64, "z": 100 },
      "player2": { "x": 150, "y": 64, "z": 100 }
    }
  ]
}

参数说明:

  • spawn-points: 传送点列表,每个传送点包含两个玩家的位置
  • player1: 挑战者的传送位置
  • player2: 目标玩家的传送位置

可选配置世界边界:

"world-border": {
  "center-x": 125,
  "center-z": 100,
  "size": 64
}

装备配置

装备配置包含四个部分:hotbar(快捷栏)、inventory(背包)、armor(盔甲)、offhand(副手)。

每个物品可以是简单字符串格式或详细对象格式。

简单格式(仅物品名):

"helmet": "diamond_helmet"

详细格式(带数量和附魔):

"0": {
  "item": "diamond_sword",
  "count": 1,
  "enchantments": {
    "sharpness": 5,
    "knockback": 2
  }
}

完整装备配置示例:

"equipment": {
  "hotbar": {
    "0": {
      "item": "diamond_sword",
      "count": 1,
      "enchantments": {
        "sharpness": 5
      }
    },
    "1": {
      "item": "bow",
      "count": 1,
      "enchantments": {
        "power": 5,
        "flame": 1,
        "infinity": 1
      }
    },
    "8": {
      "item": "arrow",
      "count": 64
    }
  },
  "inventory": {
    "0": { "item": "golden_apple", "count": 64 },
    "1": { "item": "golden_apple", "count": 64 }
  },
  "armor": {
    "helmet": {
      "item": "diamond_helmet",
      "enchantments": {
        "protection": 4,
        "unbreaking": 3
      }
    },
    "chestplate": "diamond_chestplate",
    "leggings": "diamond_leggings",
    "boots": "diamond_boots"
  },
  "offhand": {
    "item": "shield",
    "count": 1,
    "enchantments": {
      "unbreaking": 3
    }
  }
}

生命饥饿值恢复配置

"refill-health-hunger": true

参数说明:

  • true: 传送至竞技场后自动回满生命值和饥饿值,战斗结束后恢复原状态
  • false: 保持玩家原有生命值和饥饿值不变

游戏模式配置

"game-mode": "adventure"

可用值:

  • survival: 生存模式
  • creative: 创造模式
  • adventure: 冒险模式(推荐,不能破坏方块)
  • spectator: 旁观模式

其他配置

"give-night-vision": true,
"countdown-seconds": 5

参数说明:

  • give-night-vision: 是否给玩家夜视效果
  • countdown-seconds: 倒计时秒数

常用物品ID

武器

物品名物品ID
钻石剑diamond_sword
铁剑iron_sword
下届合金剑netherite_sword
石剑stone_sword
木剑wooden_sword
bow
crossbow
三叉戟trident

工具

物品名物品ID
钻石斧diamond_axe
钻石镐diamond_pickaxe
钻石铲diamond_shovel
钻石锄diamond_hoe
下届合金斧netherite_axe
下届合金镐netherite_pickaxe
下届合金铲netherite_shovel
下届合金锄netherite_hoe

盔甲

物品名物品ID
钻石头盔diamond_helmet
钻石胸甲diamond_chestplate
钻石护腿diamond_leggings
钻石靴子diamond_boots
铁头盔iron_helmet
铁胸甲iron_chestplate
铁护腿iron_leggings
铁靴子iron_boots
下届合金头盔netherite_helmet
下届合金胸甲netherite_chestplate
下届合金护腿netherite_leggings
下届合金靴子netherite_boots

其他

物品名物品ID
盾牌shield
金苹果golden_apple
箭矢arrow

常用附魔ID

武器附魔

附魔名效果最大等级
sharpness锋利5
smite亡灵杀手5
bane_of_arthropods节肢杀手5
knockback击退2
fire_aspect火焰附加2
looting抢夺3
sweeping_edge横扫之刃3

弓/弩附魔

附魔名效果最大等级
power力量5
punch冲击2
flame火矢1
infinity无限1
quick_charge快速装填3
multishot多重射击1

盔甲附魔

附魔名效果最大等级
protection保护4
fire_protection火焰保护4
blast_protection爆炸保护4
projectile_protection弹射物保护4
feather_falling摔落保护4
thorns荆棘3
unbreaking耐久3
mending经验修补1
respiration水下呼吸3
aqua_affinity水下速掘1
depth_strider深海探索者3
frost_walker冰霜行者2

工具附魔

附魔名效果最大等级
efficiency效率5
silk_touch精准采集1
fortune时运3
unbreaking耐久3
mending经验修补1

三叉戟附魔

附魔名效果最大等级
impaling穿刺5
loyalty忠诚3
riptide激流3
channeling引雷1

命令系统

玩家命令

命令说明
/duel <玩家>向指定玩家发起决斗挑战,显示玩法选择菜单
/duel <玩家> <玩法ID>直接发起指定玩法的决斗
/duel list查看所有可用玩法列表
/duel accept接受当前决斗邀请
/duel decline拒绝当前决斗邀请

管理员命令

命令说明
/pvp reload重新加载配置文件(需要管理员权限)

使用流程

发起挑战

  1. 玩家A使用 /duel <玩家B> 命令
  2. 系统显示玩法选择菜单(列出所有可用玩法)
  3. 玩家A点击选择想要的玩法
  4. 系统向玩家B发送决斗邀请

接受挑战

  1. 玩家B收到聊天消息形式的决斗邀请
  2. 点击消息中的"接受"按钮(或使用 /duel accept 命令)
  3. 系统保存双方玩家的原始数据(装备、生命值、饥饿值、位置、游戏模式)
  4. 双方玩家切换到旁观模式
  5. 系统生成或分配竞技场地
  6. 传送双方玩家到场地
  7. 开始倒计时

战斗进行

  1. 倒计时结束后,双方玩家切换到配置的游戏模式(默认冒险模式)
  2. 玩家可以正常移动和攻击
  3. 世界边界限制玩家移动范围
  4. 禁止丢弃装备

战斗结束

  1. 一方玩家阵亡后,战斗结束
  2. 胜利者立即恢复原始装备、生命值、饥饿值并传送回原位置
  3. 失败者点击重生后恢复原始装备、生命值、饥饿值并传送回原位置
  4. 场地被清理(生成模式)或释放(传送模式)

性能优化

生成模式优化

  • 采用异步分批次生成,每批次处理2048个方块
  • 区块预加载在异步线程执行
  • 方块数据准备在异步线程完成
  • 推荐场地尺寸为64x64

传送模式优化

  • 预加载场地区块
  • 配置足够的场地数量
  • 合理设置世界边界

数据持久化

玩家数据(装备、生命值、饥饿值、位置、游戏模式)在战斗开始时保存到内存和磁盘。服务器重启后,系统自动恢复离线玩家的数据。

数据文件位置:

世界目录/data/pvpmod_pending_restore.dat

注意事项

配置热重载

使用 /pvp reload 命令可以在不重启服务器的情况下重载配置,但不会影响正在进行的决斗。

更新配置文件

当模组版本更新后,如果配置文件没有更新,可以删除旧配置文件,服务器重启后会自动生成新的配置文件。

版本兼容性

模组理论上支持 Minecraft 1.21.1,但编译时使用的是 1.21.1 的 API。新版本如有重大 API 变更,可能需要重新编译。

故障排查

配置错误

检查配置文件格式是否正确,使用 JSON 验证工具确保语法无误。配置文件必须包含 display-namearena-mode 字段。

场地问题

生成模式场地未生成时,检查区块加载状态和内存使用。传送模式场地问题时,检查传送点坐标是否有效。

装备问题

装备未发放或未恢复时,检查物品ID是否正确,检查数据文件是否完整。

玩家卡住

如果玩家在战斗结束后卡住,可能是因为玩家数据未正确恢复。可以尝试使用 /duel list 命令查看是否有进行中的决斗,或重启服务器。

性能问题

TPS下降时,检查是否有大量场地同时生成,考虑使用传送模式或增加服务器资源。

扩展指南

添加新玩法

在配置文件中添加新的玩法配置块,设置场地模式、装备配置和游戏规则,使用 /pvp reload 命令重载配置即可生效。

修改现有玩法

编辑配置文件中的玩法配置,保存后使用 /pvp reload 命令使修改生效。

自定义场地设计

传送模式支持任意设计的场地,只需配置玩家传送位置和视角方向即可。


English Version

Overview

PVP Mod is a competitive arena PVP mod designed for Minecraft SMP servers. This mod provides a complete arena solution for server administrators through automated arena management, equipment distribution, and battle rules.

Core Features

Arena Management

The mod supports two arena modes:

Generate Mode Automatically generates temporary arenas that are cleaned up after battles, keeping the main world unpolluted. Arena structure has three fixed layers: bedrock layer (Y=317), grass block layer (Y=318), light layer (Y=319). Player teleport position is above the light layer (Y=319).

TP Mode Uses pre-built arenas, enabling fast player teleportation through configured spawn points. Supports multiple concurrent arenas with automatic arena occupancy detection to avoid conflicts.

Equipment System

Automatically saves player's original equipment, health, and hunger before battle, distributes temporary equipment during battle, and restores original state after battle ends.

Supported equipment types:

  • hotbar - 9 slots
  • inventory - 27 slots
  • armor - helmet, chestplate, leggings, boots
  • offhand - shield, etc.

All equipment supports enchantment configuration.

Health & Hunger Restoration

Can automatically restore health and hunger to max when teleporting to arena, and restore original values after battle ends. This feature can be enabled or disabled in config.

Security

  • Prevents item dropping during battle to prevent item duplication
  • World border limits to prevent players from escaping
  • Player data persisted to disk, supports recovery after server restart

Player Experience

  • Server-side only, no client mod required
  • Chat button interaction, easy to operate
  • Enter spectator mode after accepting duel, movement disabled during countdown
  • Automatically switch to battle mode after countdown, normal movement and attack
  • Night vision effect for arena visibility

Built-in Game Modes

Classic Duel (classic)

  • Display Name: Classic Duel
  • Description: High version sword fight PVP
  • Arena Mode: Generate
  • Equipment: Diamond sword, iron sword (Sharpness I), full diamond armor
  • Game Mode: Adventure
  • Night Vision: Enabled
  • Countdown: 5 seconds
  • Refill Health: Enabled

Epic Battle (epic)

  • Display Name: Epic Battle
  • Description: Full netherite gear, max level enchantments, full inventory
  • Arena Mode: Generate
  • Equipment: Full netherite equipment, all weapons and tools, 27 golden apples
  • Game Mode: Adventure
  • Night Vision: Enabled
  • Countdown: 5 seconds
  • Refill Health: Enabled

Configuration

Config File Location

Server Root/config/pvpmod-config.json

Config Structure

Each game mode has independent configuration with the following core sections:

{
  "game-mode-id": {
    "display-name": "Display Name",
    "description": "Game Mode Description",
    "arena-mode": "Arena Mode",
    "game-mode": "Game Mode",
    "equipment": { ... },
    "countdown-seconds": 5,
    "give-night-vision": true,
    "refill-health-hunger": true
  }
}

Chinese Field Name Support

Starting from v1.0.2, config files support Chinese field names. Chinese and English can be mixed. The following Chinese aliases are supported:

Chinese FieldEnglish FieldDescription
显示名称display-nameGame mode display name
描述descriptionGame mode description
场地模式arena-modeArena mode (tp/generate)
游戏模式game-modeGame mode
夜视效果give-night-visionEnable night vision
倒计时countdown-secondsCountdown seconds
回满生命refill-health-hungerRefill health and hunger
装备equipmentEquipment config
快捷栏hotbar9 hotbar slots
背包inventory27 inventory slots
盔甲armorArmor config
副手offhandOffhand item
头盔helmetHelmet
胸甲chestplateChestplate
护腿leggingsLeggings
靴子bootsBoots
生成配置generate-configGenerate mode config
传送配置tp-configTP mode config
传送点spawn-pointsSpawn points list
尺寸sizeArena size
最小坐标min-coordinateMin generate coordinate
最大坐标max-coordinateMax generate coordinate
物品itemItem ID
数量countItem count
附魔enchantmentsEnchantment config
世界边界world-borderWorld border config
中心Xcenter-xWorld border center X
中心Zcenter-zWorld border center Z

Note: Item IDs (e.g., diamond_sword, iron_sword), enchantment IDs (e.g., sharpness, protection), and game mode values (e.g., adventure, survival) must be in English.

Chinese Config Example:

{
  "chinese-example": {
    "显示名称": "中文配置演示",
    "描述": "使用中文配置字段的示例玩法",
    "场地模式": "generate",
    "生成配置": {
      "尺寸": 32,
      "最小坐标": 1000,
      "最大坐标": 5000
    },
    "装备": {
      "快捷栏": {
        "0": { "物品": "iron_sword", "数量": 1, "附魔": { "sharpness": 3 } }
      },
      "盔甲": {
        "头盔": { "物品": "iron_helmet" },
        "胸甲": { "物品": "iron_chestplate" }
      },
      "副手": { "物品": "shield", "数量": 1 }
    },
    "游戏模式": "adventure",
    "夜视效果": true,
    "倒计时": 3,
    "回满生命": true
  }
}

Arena Mode Configuration

Generate Mode

"arena-mode": "generate",
"generate-config": {
  "size": 64,
  "min-coordinate": 1000,
  "max-coordinate": 5000
}

Parameters:

  • size: Arena size, e.g., 64 means 64x64 arena
  • min-coordinate: Minimum coordinate for arena generation
  • max-coordinate: Maximum coordinate for arena generation

TP Mode

"arena-mode": "tp",
"tp-config": {
  "spawn-points": [
    {
      "player1": { "x": 100, "y": 64, "z": 100 },
      "player2": { "x": 150, "y": 64, "z": 100 }
    }
  ]
}

Parameters:

  • spawn-points: List of spawn points, each containing two player positions
  • player1: Challenger's teleport position
  • player2: Target player's teleport position

Optional world border configuration:

"world-border": {
  "center-x": 125,
  "center-z": 100,
  "size": 64
}

Equipment Configuration

Equipment configuration includes four parts: hotbar, inventory, armor, and offhand.

Each item can be in simple string format or detailed object format.

Simple Format (item name only):

"helmet": "diamond_helmet"

Detailed Format (with count and enchantments):

"0": {
  "item": "diamond_sword",
  "count": 1,
  "enchantments": {
    "sharpness": 5,
    "knockback": 2
  }
}

Full equipment configuration example:

"equipment": {
  "hotbar": {
    "0": {
      "item": "diamond_sword",
      "count": 1,
      "enchantments": {
        "sharpness": 5
      }
    },
    "1": {
      "item": "bow",
      "count": 1,
      "enchantments": {
        "power": 5,
        "flame": 1,
        "infinity": 1
      }
    },
    "8": {
      "item": "arrow",
      "count": 64
    }
  },
  "inventory": {
    "0": { "item": "golden_apple", "count": 64 },
    "1": { "item": "golden_apple", "count": 64 }
  },
  "armor": {
    "helmet": {
      "item": "diamond_helmet",
      "enchantments": {
        "protection": 4,
        "unbreaking": 3
      }
    },
    "chestplate": "diamond_chestplate",
    "leggings": "diamond_leggings",
    "boots": "diamond_boots"
  },
  "offhand": {
    "item": "shield",
    "count": 1,
    "enchantments": {
      "unbreaking": 3
    }
  }
}

Health & Hunger Restoration Configuration

"refill-health-hunger": true

Parameters:

  • true: Automatically restore health and hunger to max when teleporting to arena, restore original values after battle
  • false: Keep player's original health and hunger unchanged

Game Mode Configuration

"game-mode": "adventure"

Available values:

  • survival: Survival mode
  • creative: Creative mode
  • adventure: Adventure mode (recommended, cannot break blocks)
  • spectator: Spectator mode

Other Configuration

"give-night-vision": true,
"countdown-seconds": 5

Parameters:

  • give-night-vision: Whether to give players night vision effect
  • countdown-seconds: Countdown seconds

Common Item IDs

Weapons

Item NameItem ID
Diamond Sworddiamond_sword
Iron Swordiron_sword
Netherite Swordnetherite_sword
Stone Swordstone_sword
Wooden Swordwooden_sword
Bowbow
Crossbowcrossbow
Tridenttrident

Tools

Item NameItem ID
Diamond Axediamond_axe
Diamond Pickaxediamond_pickaxe
Diamond Shoveldiamond_shovel
Diamond Hoediamond_hoe
Netherite Axenetherite_axe
Netherite Pickaxenetherite_pickaxe
Netherite Shovelnetherite_shovel
Netherite Hoenetherite_hoe

Armor

Item NameItem ID
Diamond Helmetdiamond_helmet
Diamond Chestplatediamond_chestplate
Diamond Leggingsdiamond_leggings
Diamond Bootsdiamond_boots
Iron Helmetiron_helmet
Iron Chestplateiron_chestplate
Iron Leggingsiron_leggings
Iron Bootsiron_boots
Netherite Helmetnetherite_helmet
Netherite Chestplatenetherite_chestplate
Netherite Leggingsnetherite_leggings
Netherite Bootsnetherite_boots

Other

Item NameItem ID
Shieldshield
Golden Applegolden_apple
Arrowarrow

Common Enchantment IDs

Weapon Enchantments

EnchantmentEffectMax Level
sharpnessSharpness5
smiteSmite5
bane_of_arthropodsBane of Arthropods5
knockbackKnockback2
fire_aspectFire Aspect2
lootingLooting3
sweeping_edgeSweeping Edge3

Bow/Crossbow Enchantments

EnchantmentEffectMax Level
powerPower5
punchPunch2
flameFlame1
infinityInfinity1
quick_chargeQuick Charge3
multishotMultishot1

Armor Enchantments

EnchantmentEffectMax Level
protectionProtection4
fire_protectionFire Protection4
blast_protectionBlast Protection4
projectile_protectionProjectile Protection4
feather_fallingFeather Falling4
thornsThorns3
unbreakingUnbreaking3
mendingMending1
respirationRespiration3
aqua_affinityAqua Affinity1
depth_striderDepth Strider3
frost_walkerFrost Walker2

Tool Enchantments

EnchantmentEffectMax Level
efficiencyEfficiency5
silk_touchSilk Touch1
fortuneFortune3
unbreakingUnbreaking3
mendingMending1

Trident Enchantments

EnchantmentEffectMax Level
impalingImpaling5
loyaltyLoyalty3
riptideRiptide3
channelingChanneling1

Command System

Player Commands

CommandDescription
/duel <player>Challenge a specific player to a duel, shows game mode selection menu
/duel <player> <game-mode-id>Directly challenge a player with a specific game mode
/duel listView all available game modes
/duel acceptAccept current duel invitation
/duel declineDecline current duel invitation

Admin Commands

CommandDescription
/pvp reloadReload config file (requires admin permission)

Usage Flow

Initiate Challenge

  1. Player A uses /duel <playerB> command
  2. System shows game mode selection menu (lists all available game modes)
  3. Player A clicks to select desired game mode
  4. System sends duel invitation to Player B

Accept Challenge

  1. Player B receives duel invitation as a chat message
  2. Click "Accept" button in message (or use /duel accept command)
  3. System saves both players' original data (equipment, health, hunger, position, game mode)
  4. Both players switch to spectator mode
  5. System generates or allocates arena
  6. Teleport both players to arena
  7. Start countdown

Battle Progress

  1. After countdown ends, both players switch to configured game mode (adventure by default)
  2. Players can move and attack normally
  3. World border limits player movement range
  4. Equipment dropping is prohibited

Battle End

  1. Battle ends when one player dies
  2. Winner immediately restores original equipment, health, hunger, and teleports back to original position
  3. Loser restores original equipment, health, hunger, and teleports back to original position after clicking respawn
  4. Arena is cleaned up (generate mode) or released (TP mode)

Performance Optimization

Generate Mode Optimization

  • Uses asynchronous batch generation, processing 2048 blocks per batch
  • Chunk preloading executed in async thread
  • Block data preparation completed in async thread
  • Recommended arena size is 64x64

TP Mode Optimization

  • Preload arena chunks
  • Configure sufficient arenas
  • Set appropriate world borders

Data Persistence

Player data (equipment, health, hunger, position, game mode) is saved to memory and disk when battle starts. After server restart, the system automatically restores offline players' data.

Data file location:

World Directory/data/pvpmod_pending_restore.dat

Notes

Config Hot Reload

Use /pvp reload command to reload config without server restart. This does not affect ongoing duels.

Update Config File

When mod version is updated, if config file is not updated, you can delete the old config file. A new config file will be automatically generated when server restarts.

Version Compatibility

This mod theoretically supports Minecraft 1.21.1, but is compiled using 1.21.1 API. If new versions have major API changes, recompilation may be required.

Troubleshooting

Config Errors

Check if config file format is correct. Use JSON validation tools to ensure syntax is correct. Config file must contain display-name and arena-mode fields.

Arena Issues

For generate mode arena not generating, check chunk loading status and memory usage. For TP mode arena issues, check if spawn point coordinates are valid.

Equipment Issues

When equipment is not distributed or restored, check if item IDs are correct and if data files are complete.

Player Stuck

If player is stuck after battle ends, it may be because player data was not restored correctly. Try /duel list command to check for ongoing duels, or restart server.

Performance Issues

When TPS drops, check if multiple arenas are generating simultaneously. Consider using TP mode or increasing server resources.

Extension Guide

Add New Game Mode

Add a new game mode config block in the config file, set arena mode, equipment config, and game rules. Use /pvp reload command to make it take effect.

Modify Existing Game Mode

Edit the game mode config in the config file, save, and use /pvp reload command to make changes take effect.

Custom Arena Design

TP mode supports arenas with any design, just configure player teleport positions and view directions.

Часто задаваемые вопросы

Совместимость

Minecraft: Java Edition

26.2.x26.1.x1.21.x1.20.x

Платформы

Поддерживаемые окружения

Сервер

Создатели

Детали

Лицензия:
Опубликован:4 недели назад
Обновлён:3 недели назад
Главная