Skip to content

About

My first minecraft plugin, a simple fly command.

Resources

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

FlyCommand

/fly toggling flight on and off

Real in-game output from FlyCommand 1.0.0 on a local throwaway Paper 1.21.11 test server: the commands were typed by a scripted bot client, and the chat it received is drawn as Minecraft-style chat (typed commands appear in the input bars).

Description

FlyCommand is a Spigot plugin that lets permitted players toggle flight mode on and off with a single command. It adds one command, /fly, and nothing else — there is no configuration file and no persistent data.

Supported Minecraft Versions

This plugin is supported on the Minecraft versions listed in minecraft-versions.json: currently 1.19.4, 1.21.11, 26.2 and 26.3 (Spigot and its forks). Every stable release is booted on a real server of each of these versions before it is published, and the Build workflow checks that the plugin only uses Bukkit API that exists on all of them. 26.3 was added after the 1.0.0 release, so 1.0.0 was not booted on it; the next stable release will be. Other versions from 1.19.4 onwards are expected to work but are not tested. To support another version, add it to the file, which both checks read, and to the lists here and in the User Guide.

Installation

First Time Installation

  1. Download the FlyCommand jar from the latest stable release. The "Development build" prerelease on the releases page is not a stable release (see Releases).
  2. Place the jar in the plugins folder of your server.
  3. Restart your server.

The plugin targets Spigot / Paper with api-version 1.13.

Usage

Type /fly to toggle your flight on or off. The plugin confirms the new state in chat.

Documentation

Support

You can find the Dans Plugins Community Discord server here.

Experiencing a bug?

Please open a bug report here.

Contributing

Testing

mvn clean package compiles the plugin and runs its test suite. The suite reads the plugin.yml the build has prepared for the jar with Bukkit's PluginDescriptionFile, the parser a server uses, and checks that main names the plugin class, that the build filled in the version, that the name and api-version are FlyCommand and 1.13, and that the Fly command is declared. The op default of the FlyCommand.fly permission is read as plain YAML instead, because that parser needs a running server to build a permission. The suite also runs the /fly handler against stand-in senders, checking the toggle and its confirmations (including when the command is typed as /flycommand:fly), the permission-denied alert, and the console alert. Finally, it compares the docs with what they copy: the version lists here and in the User Guide must match minecraft-versions.json, every message in Main.java must be quoted in this file, the user guide and the Commands Reference, and the permission Main.java checks must appear in the user guide's table with its plugin.yml default, and in the Commands Reference and the Configuration Guide. The Build workflow runs the same command on every push to main and every pull request against it, then the Bukkit API check described under Supported Minecraft Versions, which mvn clean package does not run.

The tests do not start a server, so the plugin loading and /fly being registered are still verified by hand on a Spigot or Paper server, as described under Manual Validation.

Development

Project Layout

The plugin is a single class, built with Maven.

  • src/main/java/me/Daniel/FlyCommand/Main.java – the whole plugin
  • src/main/resources/plugin.yml – the plugin manifest, whose main value must stay equal to the package and class name of that file; its version is filled in from pom.xml at build time
  • src/test/java/ – tests of the packaged manifest, of the /fly handler, and of the docs against their sources
  • minecraft-versions.json – the supported Minecraft versions, read by the Build workflow's Bukkit API check and by the tests that compare the version lists in the docs with it

Building

Building needs Maven and a JDK; the workflows use JDK 17. JDK 8 is too old even though the jar targets Java 8, because maven.compiler.release needs JDK 9 or later.

mvn clean package

The jar is written to target/FlyCommand-<version>.jar. It is compiled for Java 8 (maven.compiler.release in pom.xml) so that it loads on the oldest servers its api-version: 1.13 admits.

Releases

Every push to main that changes anything other than Markdown files or LICENSE republishes the rolling dev prerelease (Dev Release); the workflow can also be run by hand, which republishes dev from whatever commit it is run on. Stable releases are published from a verified dev build; a release published without a jar has one built and attached by Release.

Manual Validation on a Test Server

  1. Build the jar as above.
  2. Copy it into a Spigot or Paper server's plugins folder and start the server.
  3. Confirm the plugin loads and /fly is registered.
  4. Join as an operator and run /fly twice, confirming that flight toggles each time and that the chat confirmation reads Flight enabled. when flight is turned on and Flight disabled. when it is turned off.
  5. Run /flycommand:fly, confirming that it toggles flight exactly as /fly does.
  6. Join with an account that is neither an operator nor a holder of FlyCommand.fly and run /fly, confirming that Alert: Permission 'FlyCommand.fly' required. is shown and flight is unchanged.
  7. Run /fly from the server console, confirming that Alert: Can't be used by console. is shown and that no error is logged.

Authors and Acknowledgement

Developers

Name Main Contributions
Daniel Stephenson Creator and primary developer

License

This project is licensed under the GNU General Public License v3.0 (GPL-3.0).

You are free to use, modify, and distribute this software, provided that:

  • Source code is made available under the same license when distributed.
  • Changes are documented and attributed.
  • No additional restrictions are applied.

See the LICENSE file for the full text of the GPL-3.0 license.

Project Status

The latest stable release is 1.0.0; the version under development is set in pom.xml, and changes are recorded in CHANGELOG.md. Open work is tracked on the issues page.

About

My first minecraft plugin, a simple fly command.

Resources

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages