Fabric 死亡消息

Fabric 死亡消息

一个允许你为服务器自定义各种死亡消息的Fabric模组

工具

Fabric Death Messages

注意:此模组仅限服务端使用,无法在客户端上运行

这是一个 Fabric 模组,会在玩家触发的特定事件(例如死亡、加入服务器、击杀其他玩家等)发生时,分别执行并发送可配置的命令和消息。

配置文件位于 config 目录中(config/player_events.json),内容如下所示:

{
  "death": {
    "no_entity": [
      [
        "cactus",
        "${player} was pricked to death"
      ],
      [
        "drown"
      ],
      [
        "fall"
      ],
      [
        "flyIntoWall"
      ],
      [
        "hotFloor"
      ],
      [
        "inFire"
      ],
      [
        "inWall"
      ],
      [
        "indirectMagic"
      ],
      [
        "lava"
      ],
      [
        "lightningBolt"
      ],
      [
        "onFire"
      ],
      [
        "outOfWorld"
      ],
      [
        "starve"
      ],
      [
        "wither"
      ]
    ],
    "yes_entity": [
      [
        "entity.minecraft.bee",
        "${player} was stung to death"
      ],
      [
        "entity.minecraft.blaze"
      ],
      [
        "entity.minecraft.cave_spider"
      ],
      [
        "entity.minecraft.creeper"
      ],
      [
        "entity.minecraft.dolphin"
      ],
      [
        "entity.minecraft.drowned"
      ],
      [
        "entity.minecraft.elder_guardian"
      ],
      [
        "entity.minecraft.ender_dragon"
      ],
      [
        "entity.minecraft.enderman"
      ],
      [
        "entity.minecraft.endermite"
      ],
      [
        "entity.minecraft.ghast"
      ],
      [
        "entity.minecraft.guardian"
      ],
      [
        "entity.minecraft.hoglin"
      ],
      [
        "entity.minecraft.husk"
      ],
      [
        "entity.minecraft.illusioner"
      ],
      [
        "entity.minecraft.iron_golem"
      ],
      [
        "entity.minecraft.llama"
      ],
      [
        "entity.minecraft.panda"
      ],
      [
        "entity.minecraft.phantom"
      ],
      [
        "entity.minecraft.piglin"
      ],
      [
        "entity.minecraft.piglin_brute"
      ],
      [
        "entity.minecraft.pillager"
      ],
      [
        "entity.minecraft.polar_bear"
      ],
      [
        "entity.minecraft.pufferfish"
      ],
      [
        "entity.minecraft.ravager"
      ],
      [
        "entity.minecraft.shulker"
      ],
      [
        "entity.minecraft.silverfish"
      ],
      [
        "entity.minecraft.skeleton"
      ],
      [
        "entity.minecraft.slime"
      ],
      [
        "entity.minecraft.spider"
      ],
      [
        "entity.minecraft.stray"
      ],
      [
        "entity.minecraft.tnt"
      ],
      [
        "entity.minecraft.vex"
      ],
      [
        "entity.minecraft.vindicator"
      ],
      [
        "entity.minecraft.witch"
      ],
      [
        "entity.minecraft.wither"
      ],
      [
        "entity.minecraft.wither_skeleton"
      ],
      [
        "entity.minecraft.wolf"
      ],
      [
        "entity.minecraft.zoglin"
      ],
      [
        "entity.minecraft.zombie"
      ],
      [
        "entity.minecraft.zombie_villager"
      ],
      [
        "entity.minecraft.zombified_piglin"
      ]
    ],
    "broadcast_to_everyone": true
  },
  "join": {
    "actions": [
      "Welcome ${player}",
      "/say Hello ${player}"
    ],
    "broadcast_to_everyone": true
  },
  "kill_entity": {
    "actions": [
      "${player} killed ${killedEntity}"
    ],
    "broadcast_to_everyone": true
  },
  "kill_player": {
    "actions": [
      "${player} killed ${killedPlayer}",
      "F ${killedPlayer}"
    ],
    "broadcast_to_everyone": true
  },
  "leave": {
    "actions": [
      "Goodbye ${player}!",
      "/say Hope to see you soon ${player}"
    ],
    "broadcast_to_everyone": true
  }
}

对于 death,你可以使用示例键;如果没有将消息作为第二个参数给出,则该条目视为已禁用,并会显示默认的死亡消息。

可能还有一些 yesEntity 或 noEntity 来源被遗漏了,欢迎将它们添加到你的配置文件中,一切应该都能正常工作。

对于 actions 中的其他所有字段,你可以定义多条命令,death 是唯一的例外。

格式化

0 是黑色
1 是深蓝色
2 是深绿色
3 是深青色
4 是深红色
5 是深紫色
6 是金色
7 是灰色
8 是深灰色
9 是蓝色
a 是绿色
b 是青色
c 是红色
d 是浅紫色
e 是黄色
f 是白色
----------------------------------------------------
k 是混淆
l 是粗体
m 是删除线
n 是下划线
o 是斜体