-
-
Notifications
You must be signed in to change notification settings - Fork 242
feat(velocity): document velocity-plugin.json file #735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 4 commits
cecc7e0
efc739c
673a763
abf6277
958afa4
2455466
fbc45ca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| --- | ||
| title: The Velocity plugin file | ||
| description: A full reference of the velocity-plugin.json file. | ||
| slug: velocity/dev/velocity-plugin-json | ||
| --- | ||
|
|
||
| import { FileTree } from "@astrojs/starlight/components"; | ||
|
|
||
| The `velocity-plugin.json` file is the configuration file for your plugin. It contains information | ||
| about your plugin's name, description, version, main class path, and other. It is located in the `resources` | ||
| directory of your plugin and may be generated automatically, if you configured the Velocity annotation processor | ||
| and used a `@Plugin` annotation somewhere in your code. | ||
|
|
||
| <FileTree> | ||
| - velocity-plugin/ | ||
| - src/ | ||
| - main/ | ||
| - java/ | ||
| - resources/ | ||
| - **velocity-plugin.json** | ||
| - build.gradle.kts | ||
| - settings.gradle.kts | ||
| </FileTree> | ||
|
|
||
| ## Example | ||
| This is an example `velocity-plugin.json` file: | ||
|
|
||
| ```json title=velocity-plugin.json | ||
| { | ||
| "id": "example-plugin", // required | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think the Velocity plugin file is JSONC to allow comments and I expect some people will copy-paste the code block and wonder why it doesn't work; using line markers from EC might be the way to go: https://expressive-code.com/key-features/text-markers/#adding-long-labels-on-their-own-lines
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh yeah, that's a thing. Thank you for the suggestion! |
||
| "name": "Velocity Example Plugin", | ||
| "version": "1.0.0", | ||
| "description": "An example plugin for showcasing the plugin json file.", | ||
| "main": "com.example.testplugin.TestPluginMain", // required | ||
| "url": "https://github.com/PaperMC/docs", | ||
| "authors": ["Strokkur24"], | ||
| "dependencies": [ | ||
| { | ||
| "id": "luckperms", // required for dependencies | ||
| "optional": true // defaults to false | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| ## Fields | ||
| The only required fields are `id` and `main`. Any other fields are optional. | ||
|
|
||
| - **`id`**\ | ||
| The ID of the plugin. This ID needs to be unique for each plugin. It is used for identifying your | ||
| plugin internally and also used as the name for your plugin's logger. | ||
|
|
||
| Plugin IDs must start with a lowercase letter and may contain lowercase letters, | ||
| digits, hyphens, and underscores. The total length must not exceed 64 characters. | ||
|
|
||
| ```json | ||
| {"id": "a_cool_plugin"} | ||
| ``` | ||
|
|
||
| - **`main`**\ | ||
| The path towards your main plugin class. | ||
|
|
||
| ```json | ||
| {"main": "com.example.yourplugin.PluginMain"} | ||
| ``` | ||
|
|
||
| - **`name`**\ | ||
| A user-friendly variant of your plugin's name. This is used for any user-facing display of your plugin, such | ||
| as the `/velocity plugins` command. | ||
|
|
||
| ```json | ||
| {"name": "A cool plugin"} | ||
| ``` | ||
|
|
||
| - **`version`**\ | ||
| The version of your plugin. | ||
| ```json | ||
| {"version": "0.0.1-beta.7"} | ||
| ``` | ||
|
|
||
| - **`description`**\ | ||
| The description of your plugin. | ||
| ```json | ||
| {"description": "Some interesting plugin description."} | ||
| ``` | ||
|
|
||
| - **`url`**\ | ||
| The URL of your plugin's website. | ||
| ```json | ||
| {"url": "https://github.com/PaperMC/Velocity"} | ||
| ``` | ||
|
|
||
| - **`authors`**\ | ||
| A list of your plugin's authors. | ||
| ```json | ||
| {"authors": ["Strokkur24", "electronicboy"]} | ||
| ``` | ||
|
|
||
| - **`dependencies`**\ | ||
| Your plugin's dependencies. The value of this field is an array of dependency objects. | ||
|
|
||
| The dependency object itself has two fields: | ||
| - `id` the plugin ID of the plugin you depend upon | ||
| - `optional` whether the dependency is optional. This field is not required and defaults to `false`. | ||
|
|
||
| ```json | ||
| { | ||
| "dependencies": [ | ||
| { | ||
| "id": "luckperms", | ||
| "optional": true | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
Uh oh!
There was an error while loading. Please reload this page.