๐
1 file
1,481 chars
๐
pasted-code-1792673388569.txt
txt
16 lines
โถ
pasted-code-1792673388569.txt
txt
16 lines
reate a Minecraft Paper/Spigot plugin targeting Java 21 and the latest API.
CORE IDEA:
When an event is active, regular players should see every single solid block in the world as "minecraft:stone". Server Operators (OPs) and players with a specific LuckPerms permission should see the world completely normally.
HOW IT MUST WORK:
1. Do NOT change the actual blocks on the server map. Only trick the player's game client by intercepting outgoing packets using ProtocolLib.
2. If a player is OP (player.isOp()) OR has the LuckPerms permission "event.seeblocks", send them the normal world packets.
3. If a player is a regular player (no permission, not OP), intercept their chunk loading packets and single block update packets. Swap out the IDs of all solid blocks to "minecraft:stone" before the packet hits their computer.
CRITICAL LOGIC RULES:
* Do NOT turn Air, Water, or Lava into stone (otherwise players will suffocate instantly and pools will turn solid).
* When a regular player breaks a block, they should still get the real drops (e.g., mining a block that looks like stone but is secretly diamond ore will still drop diamonds).
* Provide an admin command: `/stoneevent toggle` to turn this effect on and off globally. When turned on or off, it should automatically refresh the chunks for online players so the visuals change instantly.
Please write the complete, clean Java code for this plugin using ProtocolLib without using placeholders or skipping sections.
KodariOct 22 at 12:50 pm 1
StoneEventDisguise
A Minecraft Paper/Spigot plugin using ProtocolLib to visually disguise all solid blocks as stone during active events. Server operators and players with the LuckPerms permission "event.seeblocks" see the world normally, while regular players receive modified chunk and block update packets with solid block IDs swapped to stone. Air, water, and lava remain unchanged to prevent suffocation. Real block drops are preserved when players mine disguised blocks. Includes a /stoneevent toggle command that globally enables or disables the effect and refreshes chunks for online players to update visuals instantly.
Set up a Java 21 Paper plugin with ProtocolLib as a server-provided dependency.
Implement packet rewriting, permission bypass, toggle/refresh behavior, and
/stoneevent toggle.
[Generation stopped]
Kodari can make mistakes. Review important code before using.
Files
No files in this session
Code