Annotation Interface Documentation


@Documented @Target(METHOD) @Retention(RUNTIME) public @interface Documentation
A method annotation to denote the documentation method of a plugin message.

Every registered implementation of PluginMessage should have a static annotated method that accepts a ProtocolMessageDocumentation.Builder argument. The method may be private, but it must be static.

It is expected for these methods to edit the builder to contain information pertaining to the enclosing class' responsibility in the protocol.

An example method may look like the following:

 public final class PluginMessageClientboundCustomData implements PluginMessage<ClientboundPluginMessageListener> {

     // The actual plugin message implementation, etc.

     @Documentation
     private static void document(ProtocolMessageDocumentation.Builder documentation) {
         documentation.name("Custom Data Message")
             .description("This is the message description. This is what it does.")
             .field(MessageField.TYPE_VARINT, "Name of Data", "This is a var int that gets sent because it would be cool")
             .field(MessageField.TYPE_BLOCK_POSITION, "The Block Position", "This is a block position that is sent because we need it");
     }

 }