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.
Two features implemented:
Nether Wart Growth —
BlockGrowEventis cancelled when the block is not in aNETHERenvironment world, so wart planted in the Overworld or End simply never progresses.Portal Protection — Non-OP players are blocked from:
Breaking
NETHER_PORTALblocks (BlockBreakEvent)Igniting portals via
BlockIgniteEventRight-clicking obsidian with Flint and Steel or a Fire Charge (
PlayerInteractEvent)
OPs bypass all restrictions. Players receive a red error message when blocked.
dont forget to make it so they cant break the obsidian around nether portal block
Now add the isAdjacentToPortal helper method:
Done. The onPortalBreak handler now checks two cases:
NETHER_PORTALblock — blocked as before.OBSIDIANblock adjacent to a portal — uses the newisAdjacentToPortal()helper to check all 6 neighbours for aNETHER_PORTALblock. If found and the player isn’t OP, the break is cancelled with a message.
not with a message, i dont want any message at all in this plugin.
All three sendMessage calls removed. Actions are silently cancelled — no feedback to the player.
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
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.
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.
Two changes applied:
Obsidian break range — expanded from 1 block (adjacent only) to 2 blocks using the existing
isWithinRangeOfPortalhelper, so theisAdjacentToPortalmethod is no longer needed and was removed.Bucket restriction — new
onBucketUsehandler 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.
make it so no explosions can happen in any way within 20 blocks of a portal block
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.
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.");
}
}