3.1 skript-reflect: Reading Javadocs

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

TPGamesNL

Staff member
Moderator
Supporter
Addon Developer
Dev Programme
Jan 20, 2018
1,501
108
63
21
Most public APIs and libraries offer documentation in the form of Javadocs. Javadocs outline what features of a library are publicly accessible to developers.

Here are a few links to some commonly referenced Javadocs:

Fully qualified names
A fully qualified name is composed of a class's package and name. On the Javadoc of a class, this may be found near the top of the page. Fully qualified names are used when importing classes.

assets%2F-M9EtYI-5mJuHFlCVB2t%2Fsync%2Fe9a04fa5f98de95e16d613287a5a5df38df97f02.png

The fully qualified name of this class is org.bukkit.entity.Player
assets%2F-M9EtYI-5mJuHFlCVB2t%2Fsync%2F1b494c971cbedd1357c5fbdf1314fc4fc585cbeb.png

Classes may have an inheritance hierarchy which shows the fully qualified name of the class
If the name of the class contains a ., that is because the class is nested within another class. When referring to these classes, you must replace the . with a $.

assets%2F-M9EtYI-5mJuHFlCVB2t%2Fsync%2F8299927223bd628d1f44c9e90f3ff14a0f54fa48.png

The fully qualified name of this class is org.bukkit.Effect$Type

Typically, nested classes should be imported under an alias!



Non-public APIs
Javadocs do not describe everything available in a library. Most libraries include private classes, methods, fields, and constructors reserved for internal use. Using skript-mirror, these internal APIs are accessible just like any public API.

Usually, private APIs are private for a reason! Make sure you know what you're doing before you start digging around!



Built-in inspection
skript-mirror has built-in tools for dumping all of the available members of an object. If you need a list of these members, including their return types and input parameters, you can use the Members expression. If you only need a list of names, you can use the Member Names expression.

Source code
The best way to learn about how a library works is to read the source code! Many libraries will have their source code easily available online, though you may have to resort to decompiling libraries that are not open source.

Craftbukkit source code Online Java decompiler