HomeJavaModsZones API
Zones API

Zones API

Zones API is a lightweight system for defining and managing custom zones in a Minecraft server world. It provides core methods for creating rectangular areas (zones), checking whether entities or block positions are inside those zones, and removing zones by their identifiers.

This API serves as a foundation for implementing more complex features such as:

Features:

Zones API does not implement high-level behaviors on its own — instead, it is intended to be integrated into larger systems or extended as needed. It provides the basic spatial logic upon which other features can be built.

API Reference

package com.yeekworld.zones.api.ZonesAPI

Add dependency via JitPack: https://jitpack.io/#Wolframoviy/Zones-API (use modImplementation instead of implementation)

isInZone(ServerWorld world, BlockPos pos, Identifier zoneId)

Checks whether a specific block position is within a given zone.

Parameter Type Description
world ServerWorld The world in which the check is performed.
pos BlockPos The position to check.
zoneId Identifier The unique identifier of the zone.
Returns Description
boolean true if the position is inside the zone, otherwise false.

isInZone(Entity entity, Identifier zoneId)

Checks whether an entity is inside a specific zone.

Parameter Type Description
entity Entity The entity to check.
zoneId Identifier The identifier of the target zone.
Returns Description
boolean true if the entity is inside the zone, otherwise false.

getZoneWhereIn(ServerWorld world, BlockPos pos)

Gets a list of zone identifiers that the given block position belongs to.

Parameter Type Description
world ServerWorld The world of the position.
pos BlockPos The position to check.
Returns Description
List<Identifier> List of all zones containing the position. Empty if none.

getZoneWhereIn(Entity entity)

Gets a list of zone identifiers that the entity is currently inside.

Parameter Type Description
entity Entity The entity to check.
Returns Description
List<Identifier> List of all zones containing the entity. Empty if none.

createZone(String zoneName, BlockPos pos1, BlockPos pos2, ServerWorld world)

Creates a rectangular zone defined by two opposite corners.

Parameter Type Description
zoneName String The name of the zone (used in the ID).
pos1 BlockPos One corner of the zone.
pos2 BlockPos Opposite corner of the zone.
world ServerWorld The world where the zone is created.
Returns Description
Identifier The identifier of the new zone.

removeZone(Identifier zoneId)

Removes the zone with the given identifier.

Parameter Type Description
zoneId Identifier The ID of the zone to remove.
Returns Description
void No return value.

ℹ️ Notes

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more