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
}
你是这个资源的作者?登录后可认领此资源。
相似资源
数据包事件PacketEvents
retrooper
PacketEvents 是一款专为 Minecraft Java 版打造的协议库,旨在简化数据包的处理与传输。
前置科技
27
ExyliaLib
ExyliaServices
ExyliaPlugins 的库。
前置实用
26
ProAuthMeLogin
3623813757
通过对话框或铁砧界面帮助你的 Anthme
实用
16
可自定义玩家模型
tom5454
自定义你的Minecraft头像!
装饰社交
16
Vessel
muhdfdeen
重新定义服务器上的生物运输方式。使用高度可定制的口袋道具,安全地捕获、存储和释放任何实体。
生物存储
13
Vivecraft Spigot Extension
fayer3
为基于 Spigot/Paper/Folia 的服务器添加对 Vivecraft 的支持
前置实用
12
评论 0
登录后参与评分
还没有评论,来抢沙发吧