Registration modes
Default: Inferred. Set registration.annotationProcessingMode in build.gradle.kts.
Selection and export
Every mode reads the same annotations, meta-annotations included, and only registers candidates: a public class that is not an object, and its public instance members. The mode sets the annotation assumed on a candidate that has none written; a written annotation replaces that default. An annotation written on something that is not a candidate, such as a private or static member, an object, an extension function or one of several same-name overloads, fails the build and is flagged by the IDE.
| Declaration or behavior |
Inferred |
Explicit |
Automatic |
| Class |
@Script |
@Script |
Assumed @Script |
| Property |
@Visible |
@Visible |
Assumed @Export |
| Inspector export |
@Export |
@Export |
Every property, unless @Visible or @Storage is written |
| Ordinary function |
@Register |
@Register |
Assumed @Register |
| Godot virtual override |
Assumed @Register |
@Register |
Assumed @Register |
| Signal |
Assumed @Emit |
@Emit |
Assumed @Emit |
| Notification handler |
@Notification |
@Notification |
@Notification |
@Export carries @Storage, which carries @Visible; property hints carry @Export; @Rpc and @Notification carry @Register; @Tool carries @Script. Inspector export is a separate property flag. Class selection does not guarantee that Godot can instantiate the class.
Accessor-shaped functions also follow the property/function intent rules. The table does not override those rules.
Inferred
Annotations select declarations. Godot overrides and typed signals are assumed registered without one.
With Inferred selected, this class produces:
| Godot declaration |
Result |
Player |
Registered script; public no-argument construction |
health |
Integer property, exported to the Inspector |
health_changed |
Signal with one integer argument |
heal(amount) |
Callable function with one integer argument |
_ready() |
Godot lifecycle callback |
Explicit
Nothing is assumed: every registered declaration carries an annotation, written or carried by another one. Overrides need @Register and signals need @Emit. @Export alone exports a property and @Rpc alone registers an RPC method, as in the other modes.
With Explicit selected, this class produces:
| Godot declaration |
Result |
Player |
Registered script; public no-argument construction |
health |
Integer property, exported to the Inspector |
health_changed |
Signal with one integer argument |
heal(amount) |
Callable function with one integer argument |
_ready() |
Godot lifecycle callback |
Automatic
Every candidate is assumed registered without annotations, and properties are assumed @Export. Writing @Visible or @Storage replaces that default with the lower exposure. Annotations that add something the default lacks, such as @Rpc, must still be written. Annotations also configure names, hints, and notifications.
With Automatic selected, this class produces:
| Godot declaration |
Result |
Player |
Registered script; public no-argument construction |
health |
Integer property, exported to the Inspector |
health_changed |
Signal with one integer argument |
heal(amount) |
Callable function with one integer argument |
_ready() |
Godot lifecycle callback |
Without @Script, name the source file Player.kt, Player.java, or Player.scala. See script files.
Shared requirements
- Classes and inheritance: bases, constructors, abstract classes, inherited declarations.
- Properties: visibility, accessors, supported types, initialization.
- Functions, notifications and RPC: signatures, selection, notifications and networking.
- Signals: declaration forms, argument types and names.
- Script files and registered names: source association,
.gdj and naming policies.