Paper Plugin Guide
File mode0

Java basics

Packages, imports and visibility

Where classes live, how to use classes from other packages, and who can see what.

Beginner1 min read

This page is still being written.

What it will cover

  • Packages as folders; fully qualified names (org.bukkit.entity.Player)
  • import statements; wildcard imports and why IntelliJ avoids them; static imports
  • Name clashes (two classes called Sound: org.bukkit.Sound and net.kyori.adventure.sound.Sound) and how to handle them
  • Access modifiers table: public, protected, package-private, private
  • final for classes, methods, variables; static
  • The cannot find symbol and package does not exist errors and how to fix them (Alt+Enter)
  • Where Paper classes live: a map of the main packages (org.bukkit.*, io.papermc.paper.*, net.kyori.adventure.*, com.mojang.brigadier.*)