A collection of ready-to-use Minecraft (Bukkit/Spigot) utility snippets in Java and Kotlin.
MCUtils is a community-driven repository of reusable Minecraft plugin code snippets for Bukkit / Spigot / Paper servers. Each snippet is self-contained and ready to copy into your own plugin. All snippets are available in both Java and Kotlin.
- Copy the desired snippet into your plugin project.
- Register commands in your
plugin.yml:commands: heal: description: Heal a player fly: description: Toggle fly mode gm: description: Change gamemode broadcast: description: Broadcast a message give: description: Give items to a player speed: description: Set player speed tp: description: Teleport a player kill: description: Kill a player feed: description: Feed a player clearinv: description: Clear a player's inventory
- Register listeners and commands in your main class (see
MainClassExample.javaorMainClassFull.kt).
| File | Description |
|---|---|
NoHunger.java |
Prevents players from losing hunger |
NoWeatherChange.java |
Prevents weather from changing |
NoFallDamage.java |
Disables fall damage for all entities |
NoFireDamage.java |
Disables fire and lava damage |
NoExplosionDamage.java |
Disables explosion damage |
NoItemDropOnDeath.java |
Prevents item drops on player death |
NoBlockBreak.java |
Restricts block breaking by permission |
NoBlockPlace.java |
Restricts block placing by permission |
NoMobSpawn.java |
Prevents hostile mobs from spawning naturally |
InfiniteArrows.java |
Prevents arrows from being consumed |
CustomJoinMessage.java |
Custom colored join message |
CustomQuitMessage.java |
Custom colored quit message |
ChatFormat.java |
Custom chat format with optional color code support |
AntiSwear.java |
Blocks forbidden words in chat |
PotionEffectOnJoin.java |
Gives players permanent potion effects on join |
| File | Description | Usage |
|---|---|---|
HealCommand.java |
Heal yourself or another player | /heal [player] |
FeedCommand.java |
Feed yourself or another player | /feed [player] |
KillCommand.java |
Kill yourself or another player | /kill [player] |
FlyCommand.java |
Toggle fly mode | /fly [player] |
GameModeCommand.java |
Change gamemode (0-3) | /gm <0|1|2|3> [player] |
TeleportCommand.java |
Teleport yourself or a player | /tp <player> [target] |
GiveItemCommand.java |
Give items to a player | /give <player> <material> [amount] |
SpeedCommand.java |
Set walk/fly speed (1-10) | /speed <1-10> [player] |
ClearInventoryCommand.java |
Clear a player's inventory | /clearinv [player] |
BroadcastCommand.java |
Broadcast a message to all players | /broadcast <message> |
| File | Description |
|---|---|
MainClassExample.java |
Example main plugin class with command & listener registration |
| File | Description |
|---|---|
ExampleListener.kt |
Basic listener example (BlockBreakEvent) |
NoFallDamage.kt |
Disables fall damage |
JoinQuitListener.kt |
Custom join and quit messages |
AntiSwearListener.kt |
Blocks forbidden words in chat |
BuildPermissionListener.kt |
Restricts building by permission |
| File | Description | Usage |
|---|---|---|
ExampleCommand.kt |
Basic command example | /example |
HealCommand.kt |
Heal yourself or another player | /heal [player] |
FlyCommand.kt |
Toggle fly mode | /fly [player] |
GameModeCommand.kt |
Change gamemode (0-3) | /gm <0|1|2|3> [player] |
BroadcastCommand.kt |
Broadcast a message to all players | /broadcast <message> |
| File | Description |
|---|---|
MainClass.kt |
Minimal main class example |
MainClassFull.kt |
Full main class with all snippets registered |
| File | Description |
|---|---|
startscript_linux.sh |
Start script for Linux |
startscript_win.bat |
Start script for Windows |
Contributions are welcome! If you have a useful Minecraft plugin snippet you'd like to share:
- Fork the repository
- Add your snippet to the
Java/orKotlin/folder - Update the README table with a short description
- Open a Pull Request
Made with ❤️ by PaxonicYT and contributors