This repository was archived by the owner on Dec 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +34
-3
lines changed
Expand file tree Collapse file tree 4 files changed +34
-3
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,8 @@ export default defineConfig({
1919 collapsed : false ,
2020 items : [
2121 { text : "概述" , link : "plugin/overview" } ,
22- { text : "事件" , link : "plugin/event" }
22+ { text : "事件" , link : "plugin/event" } ,
23+ { text : "指令" , link : "plugin/command" }
2324 ]
2425 } ,
2526 {
Original file line number Diff line number Diff line change 1+ ---
2+ title : 指令
3+ ---
4+
5+ # 指令
6+
7+ ## 基本运用
8+
9+ > 该插件系统的指令未完善,主要应为是权限那块没弄好
10+
11+ ``` lua
12+ local plugin = function (plugin )
13+ -- 玩家加入事件
14+ local command = function (sender , name , args )
15+ sender :sendMessage (" hello world!!" )
16+ end
17+
18+ plugin .enable = function ()
19+ -- 注册事件
20+ plugin .command .register (" test" , command , {
21+ description = " This is a test command" ,
22+ usage = " /<Command>"
23+ })
24+ end
25+ end
26+
27+ -- 编写meta和注册自己明白
28+ ```
Original file line number Diff line number Diff line change @@ -8,13 +8,13 @@ title: 事件
88
99## 基本运用
1010
11- > 该插件系统暂时只有玩家加入游戏事件(
11+ > 该插件系统的事件已经大部分完善,事件名与Bukkit事件类名对照在这里: [ EventMap.java ] ( https://github.com/MenthaMC/LemonMint/blob/dev/1.21.8/lemint-server/src/main/java/me/coderfrish/event/EventMap.java )
1212
1313``` lua
1414local plugin = function (plugin )
1515 -- 玩家加入事件
1616 local join = function (event )
17- event .setJoinMessage (" Welcome " .. event . player . name .. " Join this server!!" )
17+ event .setJoinMessage (" Welcome " .. event : getPlayer (): getName () .. " Join this server!!" )
1818 end
1919
2020 plugin .enable = function ()
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ title: 插件系统概述
1212
1313该插件系统不需要引入Jar包也不需要用什么构建系统,一个文件就可以搞定。
1414
15+ > 注:meta中name和version是必须写的,不然会报错。
16+
1517``` lua
1618local plugin = function (plugin )
1719 plugin .enable = function ()
You can’t perform that action at this time.
0 commit comments