▶️ ЗАБЕРИ СВОИ 8 ПОДАРКОВ 🎁 ПРИ СОЗДАНИИ СВОЕГО МАЙНКРАФТ СЕРВЕРА
Моды/RestrictMob
RestrictMob

RestrictMob

RestrictMob. It provides server administrators with a streamlined system to define Safe Zones where hostile and neutral mobs.

3
1
Все версииRestrictMob 1.0

RestrictMob 1.0

Release2 нед. назад

Список изменений

RestrictMob

A lightweight, high-performance Minecraft plugin that allows server administrators to define Safe Zones where hostile and neutral mobs cannot spawn or enter.

Built for Paper 1.21+ with Java 21. Zero per-tick overhead — uses event-driven checks only.


Features

  • Zone Creation — Select two corners with a wand item (default: Blaze Rod) and define named rectangular zones.
  • Spawn Prevention — Blocks hostile and neutral mob spawns inside zones from all sources (natural, spawner, egg, custom, etc.).
  • Entry Prevention — Prevents mobs from walking or teleporting into zones using Paper's EntityMoveEvent with proximity pre-filtering.
  • Knockback — Mobs attempting to cross a zone boundary are gently pushed back (configurable strength).
  • Async Persistence — Zones are saved to data/zones.yml asynchronously. No file I/O on the main thread during gameplay.
  • Fully Configurable — Wand item, check radius, knockback multiplier, teleport blocking toggle, and all messages are editable in config.yml.

Requirements

RequirementVersion
ServerPaper 1.21+ (or any Paper fork such as Purpur)
Java21 or newer
Build ToolMaven 3.9+

Installation

  1. Clone the repository and build:
    mvn clean package
    
  2. Copy target/RestrictMob-1.0.jar into your server's plugins/ folder.
  3. Restart or reload the server.

Commands

All commands require the titanzones.admin permission (default: op).

CommandDescription
/zones wandGives the selection wand item
/zones create <name>Creates a zone from your current two-point selection
/zones delete <name>Removes a saved zone
/zones listLists all active zones with coordinates

Selection Workflow

  1. Run /zones wand to receive the selection tool.
  2. Left-click a block to set Position 1.
  3. Right-click a block to set Position 2.
  4. Run /zones create <name> to save the zone.

Both positions must be in the same world. The wand is identified by a persistent data tag, not by its display name.


Configuration

Default config.yml:

wand-item: BLAZE_ROD
check-radius: 5.0
knockback-multiplier: 1.5
block-teleport: true

messages:
  prefix: "&8[&6TitanZones&8] "
  zone-created: "&aZone '&e%name%&a' created successfully."
  zone-deleted: "&cZone '&e%name%&c' deleted."
  # ... (all messages are customizable)
KeyDescription
wand-itemMaterial name for the selection wand
check-radiusDistance (blocks) from zone boundaries to begin evaluating entity movement
knockback-multiplierVelocity multiplier for boundary knockback. Set to 0 to disable.
block-teleportWhether to cancel entity teleportation into zones

How It Works

  • Spawn blocking listens to CreatureSpawnEvent and EntitySpawnEvent. Any hostile or neutral mob spawning inside a zone is cancelled regardless of spawn reason.
  • Movement blocking uses Paper's EntityMoveEvent with a three-stage filter:
    1. Skip non-restricted entities (players, passive animals, villagers).
    2. Skip sub-block movement (hasChangedBlock() check).
    3. Skip entities far from any zone (pre-expanded bounding box proximity test).
    4. Cancel and apply knockback only when a mob crosses from outside to inside a zone.
  • Teleport blocking intercepts EntityTeleportEvent for the same entity types.
  • Entities already inside a zone (e.g., zone created around them) are allowed to move freely so they can leave.

Permissions

PermissionDescriptionDefault
titanzones.adminAccess to all /zones commandsop

Project Structure

src/main/java/com/titanzones/
  TitanZonesMain.java      Plugin entry point
  ZoneManager.java          Zone storage, spatial queries, async I/O
  ZoneCommand.java          Command handler and selection tracking
  ZoneTabCompleter.java     Tab completion for subcommands and zone names
  ZoneListener.java         Event listeners for spawns, movement, teleport, wand clicks

src/main/resources/
  plugin.yml                Plugin metadata
  config.yml                Default configuration

License

This project is provided as-is. See the repository for license details.

Файлы

RestrictMob-1.0.jar(20.37 KiB)
Основной
Скачать

Метаданные

Канал релиза

Release

Номер версии

1.0

Загрузчики

Bukkit
Paper
Purpur
Spigot

Версии игры

1.21–1.21.11

Загрузок

3

Дата публикации

2 нед. назад

Загрузил

ID версии

Главная