@@ -7,10 +7,9 @@ slug: velocity/dev/velocity-plugin-json
77import { FileTree } from " @astrojs/starlight/components" ;
88
99The ` velocity-plugin.json ` file is the configuration file for your plugin. It contains information
10- about your plugin's name, description, version, main class path, and other.
11-
12- The ` velocity-plugin.json ` file is located in the ` resources ` directory of your plugin. It is generated
13- automatically if you configured the Velocity annotation processor and used the ` @Plugin ` annotation.
10+ about your plugin's name, description, version, main class path, and other. It is located in the ` resources `
11+ directory of your plugin and may be generated automatically, if you configured the Velocity annotation processor
12+ and used a ` @Plugin ` annotation somewhere in your code.
1413
1514<FileTree >
1615 - velocity-plugin/
@@ -28,62 +27,89 @@ This is an example `velocity-plugin.json` file:
2827
2928``` json title=velocity-plugin.json
3029{
31- "id" : " example-plugin" ,
30+ "id" : " example-plugin" , // required
3231 "name" : " Velocity Example Plugin" ,
3332 "version" : " 1.0.0" ,
3433 "description" : " An example plugin for showcasing the plugin json file." ,
35- "main" : " com.velocitypowered.testplugin.TestPluginMain"
36- }
37- ```
38-
39- ## Fields
40- The only required fields are ` id ` and ` main ` . Any other fields are optional.
41-
42- ### id
43- The ID of the plugin. This ID needs to be unique for each plugin.
44- - ` "id": "a_cool_plugin" `
45-
46- Plugin IDs must start with a lowercase letter and may contain lowercase letters,
47- digits, hyphens, and underscores. The total length must not exceed 64 characters.
48-
49- ### main
50- The path towards your main plugin class.
51- - ` "main": "com.example.yourplugin.PluginMain" `
52-
53- ### name
54- A user-friendly variant of your plugin's name.
55- - ` "name": "A cool plugin" `
56-
57- ### version
58- The version of your plugin.
59- - ` "version": "0.0.1-beta.7" `
60-
61- ### description
62- The description of your plugin.
63- - ` "description": "Some interesting plugin description." `
64-
65- ### url
66- The URL of your plugin's website.
67- - ` "url": "https://github.com/PaperMC/Velocity" `
68-
69- ### authors
70- A list of your plugin's authors.
71- - ` "authors": ["Strokkur24", "electronicboy"] `
72-
73- ### dependencies
74- Your plugin's dependencies. The value of this field is an array of dependency objects.
75-
76- The dependency object itself has two fields:
77- - ` id ` the plugin ID of the plugin you depend upon
78- - ` optional ` whether the dependency is optional. This field is not required and defaults to ` false ` .
79-
80- ``` json
81- {
34+ "main" : " com.example.testplugin.TestPluginMain" , // required
35+ "url" : " https://github.com/PaperMC/docs" ,
36+ "authors" : [" Strokkur24" ],
8237 "dependencies" : [
8338 {
84- "id" : " luckperms" ,
85- "optional" : true
39+ "id" : " luckperms" , // required for dependencies
40+ "optional" : true // defaults to false
8641 }
8742 ]
8843}
8944```
45+
46+ ## Fields
47+ The only required fields are ` id ` and ` main ` . Any other fields are optional.
48+
49+ - ** ` id ` ** \
50+ The ID of the plugin. This ID needs to be unique for each plugin. It is used for identifying your
51+ plugin internally and also used as the name for your plugin's logger.
52+
53+ Plugin IDs must start with a lowercase letter and may contain lowercase letters,
54+ digits, hyphens, and underscores. The total length must not exceed 64 characters.
55+
56+ ``` json
57+ {"id" : " a_cool_plugin" }
58+ ```
59+
60+ - ** ` main ` ** \
61+ The path towards your main plugin class.
62+
63+ ``` json
64+ {"main" : " com.example.yourplugin.PluginMain" }
65+ ```
66+
67+ - ** ` name ` ** \
68+ A user-friendly variant of your plugin's name. This is used for any user-facing display of your plugin, such
69+ as the ` /velocity plugins ` command.
70+
71+ ``` json
72+ {"name" : " A cool plugin" }
73+ ```
74+
75+ - ** ` version ` ** \
76+ The version of your plugin.
77+ ``` json
78+ {"version" : " 0.0.1-beta.7" }
79+ ```
80+
81+ - ** ` description ` ** \
82+ The description of your plugin.
83+ ``` json
84+ {"description" : " Some interesting plugin description." }
85+ ```
86+
87+ - ** ` url ` ** \
88+ The URL of your plugin's website.
89+ ``` json
90+ {"url" : " https://github.com/PaperMC/Velocity" }
91+ ```
92+
93+ - ** ` authors ` ** \
94+ A list of your plugin's authors.
95+ ``` json
96+ {"authors" : [" Strokkur24" , " electronicboy" ]}
97+ ```
98+
99+ - ** ` dependencies ` ** \
100+ Your plugin's dependencies. The value of this field is an array of dependency objects.
101+
102+ The dependency object itself has two fields:
103+ - ` id ` the plugin ID of the plugin you depend upon
104+ - ` optional ` whether the dependency is optional. This field is not required and defaults to ` false ` .
105+
106+ ``` json
107+ {
108+ "dependencies" : [
109+ {
110+ "id" : " luckperms" ,
111+ "optional" : true
112+ }
113+ ]
114+ }
115+ ```
0 commit comments