sunchl

an 1.21.11 paper server plugin.

make it so nether wart can't grow anywhere else except nether. and make it so nether portals cant be lit up or broken, only by people with OP.

Kodari AI
KodariJun 25 at 12:38 am 3
NetherRestrictions
A Paper 1.21.1 plugin that enforces two nether-specific restrictions. Nether wart can only grow in the Nether environment — any growth attempt in other worlds is cancelled. Nether portals are protected from being lit or broken by non-OP players; operators retain full control. Lightweight, event-driven, and requires no configuration.

Two features implemented:

  • Nether Wart Growth — BlockGrowEvent is cancelled when the block is not in a NETHER environment world, so wart planted in the Overworld or End simply never progresses.

  • Portal Protection — Non-OP players are blocked from:

    • Breaking NETHER_PORTAL blocks (BlockBreakEvent)

    • Igniting portals via BlockIgniteEvent

    • Right-clicking obsidian with Flint and Steel or a Fire Charge (PlayerInteractEvent)

OPs bypass all restrictions. Players receive a red error message when blocked.

sunchl

dont forget to make it so they cant break the obsidian around nether portal block

Kodari AI
KodariJun 25 at 12:39 am 7

Now add the isAdjacentToPortal helper method:

Done. The onPortalBreak handler now checks two cases:

  1. NETHER_PORTAL block — blocked as before.

  2. OBSIDIAN block adjacent to a portal — uses the new isAdjacentToPortal() helper to check all 6 neighbours for a NETHER_PORTAL block. If found and the player isn’t OP, the break is cancelled with a message.

sunchl

not with a message, i dont want any message at all in this plugin.

Kodari AI
KodariJun 25 at 12:40 am 3

All three sendMessage calls removed. Actions are silently cancelled — no feedback to the player.

sunchl

you also should make them unable to place anything 2 blocks near a portal block so they cant put water bucket inside and break it or move it with a piston

Kodari AI
KodariJun 25 at 1:05 am 5

Three new protections added, all silently cancelled for non-OPs:

  • BlockPlaceEvent — blocks any placement within 2 blocks (Manhattan distance) of a portal block, preventing water buckets and other griefing items from being placed nearby.

  • BlockPistonExtendEvent / BlockPistonRetractEvent — cancels piston movement if any of the pushed/pulled blocks are within 2 blocks of a portal.

  • BlockFromToEvent — stops water and lava from flowing into the 2-block zone around a portal.

sunchl

maybe you should completely remove the usage of any type of buckets when near 6 blocks of a nether portal, and make it so they cant break obsidian near 2 blocks a nether portal block too, instead of 1 as it currently is.

Kodari AI
KodariJun 25 at 1:14 am 5

Two changes applied:

  • Obsidian break range — expanded from 1 block (adjacent only) to 2 blocks using the existing isWithinRangeOfPortal helper, so the isAdjacentToPortal method is no longer needed and was removed.

  • Bucket restriction — new onBucketUse handler cancels any right-click interaction with all bucket types (empty, water, lava, powder snow, and all fish/axolotl/tadpole buckets) within 6 blocks of a portal for non-OP players.

sunchl

make it so no explosions can happen in any way within 20 blocks of a portal block

Kodari AI
KodariJul 2 at 3:32 pm 4

Both EntityExplodeEvent (creepers, TNT, ghasts, etc.) and BlockExplodeEvent (bed/respawn anchor explosions) are cancelled if the explosion origin is within 20 blocks of any nether portal block.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
4 234
src/main/java/com/netherrestrictions/NetherRestrictions.java
package com.netherrestrictions;

import org.bukkit.plugin.java.JavaPlugin;

public class NetherRestrictions extends JavaPlugin {

    @Override
    public void onEnable() {
        getServer().getPluginManager().registerEvents(new NetherListener(), this);
        getLogger().info("NetherRestrictions enabled.");
    }

    @Override
    public void onDisable() {
        getLogger().info("NetherRestrictions disabled.");
    }
}