LittleWeb

插件

· 作者 Pequla

Spigot 插件,为开发者提供可消费的 REST API

0 本站下载 0 关注 更新于 3 年前

需要前置:LittleLink

最新 1.4 · 1.20.1 · Paper / Purpur

一键开服(送7天)

LittleWeb

Spigot 插件,为开发者提供 REST API

需要插件 LittleLink

配置

api:
  port: 8888
  address: localhost
  • port:HTTP Jetty 服务器绑定的端口,必须大于 1024,因为 Minecraft 服务器不应以 root 用户运行
  • address:HTTP Jetty 服务器监听的地址。如果你想在不使用反向代理的情况下暴露 API,可以将其设置为 0.0.0.0

API 端点

插件目前仅提供 2 个端点

GET /api/status

示例响应:

{
  "players": {
    "max": 30,
    "online": 3,
    "list": [
      {
        "id": "12b7b9c9-7611-4679-bae8-94ed55a6b7a4",
        "name": "jb_himawari"
      },
      {
        "id": "eaf3de81-e7e9-4395-a0b1-456735b63aa7",
        "name": "Twan_MC"
      },
      {
        "id": "5be97b0c-657f-4fb9-baa8-b463b3040c28",
        "name": "Rekcah_"
      }
    ]
  },
  "world": {
    "seed": "-4255308501429674615",
    "time": 2832,
    "type": "minecraft:normal"
  },
  "plugins": [
    {
      "name": "CoreProtect",
      "version": "21.2",
      "authors": [
        "Intelli"
      ],
      "description": "Provides block protection for your server.\n",
      "website": "http://coreprotect.net"
    },
    {
      "name": "LuckPerms",
      "version": "5.4.26",
      "authors": [
        "Luck"
      ],
      "description": "A permissions plugin",
      "website": "https://luckperms.net"
    },
    {
      "name": "CustomBeaconRange",
      "version": "0.1",
      "authors": [
        "Soussou"
      ],
      "description": "A plugin to customize beacon effect range",
      "website": null
    },
    {
      "name": "LittleLink",
      "version": "1.7",
      "authors": [
        "Pequla"
      ],
      "description": "Allows for simple whitelisting on the minecraft server",
      "website": "https://pequla.com"
    },
    {
      "name": "LittleWeb",
      "version": "1.3",
      "authors": [
        "Pequla"
      ],
      "description": "Exposes a public REST API from data found in LittleLink",
      "website": "https://github.com/Pequla/LittleWeb"
    },
    {
      "name": "LittleHooks",
      "version": "1.2",
      "authors": [
        "Pequla"
      ],
      "description": "Discord webhook integration for your minecraft server",
      "website": "https://pequla.com"
    },
    {
      "name": "spark",
      "version": "1.9.9",
      "authors": [
        "Luck"
      ],
      "description": "spark is a performance profiling plugin/mod for Minecraft clients, servers and proxies.",
      "website": "https://spark.lucko.me/"
    },
    {
      "name": "Vault",
      "version": "1.7.3-b131",
      "authors": [
        "cereal",
        "Sleaker",
        "mung3r"
      ],
      "description": "Vault is a Permissions & Economy API to allow plugins to more easily hook into these systems without needing to hook each individual system themselves.",
      "website": "https://dev.bukkit.org/projects/vault"
    },
    {
      "name": "Essentials",
      "version": "2.19.5-dev+23-6816eb4",
      "authors": [
        "Zenexer",
        "ementalo",
        "Aelux",
        "Brettflan",
        "KimKandor",
        "snowleo",
        "ceulemans",
        "Xeology",
        "KHobbits",
        "md_5",
        "Iaccidentally",
        "drtshock",
        "vemacs",
        "SupaHam",
        "mdcfe",
        "JRoy",
        "pop4959"
      ],
      "description": "Provides an essential, core set of commands for Bukkit.",
      "website": "https://essentialsx.net/"
    },
    {
      "name": "EssentialsChat",
      "version": "2.19.5-dev+23-6816eb4",
      "authors": [
        "Zenexer",
        "ementalo",
        "Aelux",
        "Brettflan",
        "KimKandor",
        "snowleo",
        "ceulemans",
        "Xeology",
        "KHobbits",
        "md_5",
        "Okamosy",
        "Iaccidentally",
        "mdcfe",
        "JRoy",
        "triagonal"
      ],
      "description": "Provides chat control features for Essentials.  Requires Permissions.",
      "website": "https://essentialsx.net/"
    },
    {
      "name": "LWC",
      "version": "2.2.7-ad0f824",
      "authors": [
        "Hidendra",
        "pop4959",
        "Me_Goes_RAWR"
      ],
      "description": "Inventory protection & management utilizing SQLite or MySQL as its backend Other blocks can also be protected individually, if configured.\n",
      "website": "https://www.spigotmc.org/resources/lwc-extended.69551/"
    },
    {
      "name": "EssentialsSpawn",
      "version": "2.19.5-dev+23-6816eb4",
      "authors": [
        "Zenexer",
        "ementalo",
        "Aelux",
        "Brettflan",
        "KimKandor",
        "snowleo",
        "ceulemans",
        "Xeology",
        "KHobbits",
        "SupaHam",
        "mdcfe",
        "DoNotSpamPls",
        "JRoy"
      ],
      "description": "Provides spawn control commands, utilizing Essentials.",
      "website": "https://essentialsx.net/"
    },
    {
      "name": "Harbor",
      "version": "1.6.3",
      "authors": [
        "TechToolbox (@nkomarn)"
      ],
      "description": "Harbor redefines how sleep works in your server, making it easier for all the online players to get in bed quickly and skip through the night!",
      "website": "https://nkomarn.xyz"
    }
  ],
  "version": "git-Paper-41 (MC: 1.19)"
}

当没有玩家在线时,list 将返回为空数组

还有针对特定字段的额外端点:

  • GET /api/status/players(仅返回 players 对象)
  • GET /api/status/plugins(仅返回 plugins 数组)
  • GET /api/status/world(仅返回 world 对象)

GET /api/user

uuid 查询参数是必填的。因此示例 URL 应为 /api/user?uuid=69c154a4-0a6a-4578-b169-c4be379e1e8e

示例响应:

{
    "id": "407635624787443712",
    "name": "LYuae#5987",
    "nickname": "Yuae %",
    "avatar": "https://cdn.discordapp.com/avatars/407635624787443712/8d80be04a42c5622aa5ebe358c68ea67.png"
}

GET /api/players

显示所有曾加入过该服务器的玩家

示例响应:

[
  {
    "id": "12b7b9c9-7611-4679-bae8-94ed55a6b7a4",
    "name": "jb_himawari"
  },
  {
    "id": "eaf3de81-e7e9-4395-a0b1-456735b63aa7",
    "name": "Twan_MC"
  },
  {
    "id": "5be97b0c-657f-4fb9-baa8-b463b3040c28",
    "name": "Rekcah_"
  }
]

异常与状态码

如果出现错误,您可能会收到以下状态码:

  • 404 NOT FOUND - 未找到所需对象
  • 400 BAD REQUEST - 处理请求参数时出错
  • 500 SERVER ERROR - 内部发生错误,您可能需要重启 Minecraft 服务器

示例响应:

{
    "message": "User not found",
    "timestamp": 1655245110448
}

你是这个资源的作者?登录后可认领此资源。

评论 0

0.0
暂无评分
5 星
0
4 星
0
3 星
0
2 星
0
1 星
0
我的评分

登录后参与评分

还没有评论,来抢沙发吧

评论配图

相似资源