package dev.okenote.region;

import net.kyori.adventure.text.Component;
import net.minestom.server.coordinate.Point;
import net.minestom.server.entity.Entity;
import java.util.Set;

public record Region(Component title, Point pos1, Point pos2, Set<RegionFlags> flags) {

    public boolean contains(Point point) {
        double minX = Math.min(pos1.x(), pos2.x());
        double maxX = Math.max(pos1.x(), pos2.x());
        double minY = Math.min(pos1.y(), pos2.y());
        double maxY = Math.max(pos1.y(), pos2.y());
        double minZ = Math.min(pos1.z(), pos2.z());
        double maxZ = Math.max(pos1.z(), pos2.z());

        return point.x() >= minX && point.x() <= maxX &&
                point.y() >= minY && point.y() <= maxY &&
                point.z() >= minZ && point.z() <= maxZ;
    }

    public boolean contains(Entity entity) {
        return contains(entity.getPosition());
    }
}

package dev.okenote.region;

import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import net.minestom.server.coordinate.Pos;

import java.util.*;
import java.util.concurrent.ConcurrentHashMap;

public class RegionsManager {

    private final Map<String, Region> regions = new ConcurrentHashMap<>();

    public void init() {
        addRegion("spawn", new Region(Component.text("Спавн", NamedTextColor.GOLD),
                new Pos(43, 30, 38),
                new Pos(53, 1, 48),
                Set.of(RegionFlags.PVP_DENY, RegionFlags.FALL_DAMAGE_DENY)));
    }

    public void addRegion(String regionId, Region region) {
        regions.put(regionId, region);
    }

    public Region getRegion(String id) {
        return regions.get(id);
    }
}

package dev.okenote.region;

public enum RegionFlags {

    PVP_DENY,
    FALL_DAMAGE_DENY
}

Улучши все методы, а так же сделай в EntityAttackEvent отключение PvP, если игрок находиться в регионе, а так же отключи получение урона от падения в моём классе

package dev.okenote.modules;

import dev.okenote.JediCraft;
import dev.okenote.database.User;
import dev.okenote.entities.player.JediPlayer;
import dev.okenote.project.module.GameModule;
import lombok.AccessLevel;
import lombok.experimental.FieldDefaults;
import net.minestom.server.coordinate.Pos;
import net.minestom.server.entity.damage.DamageType;
import net.minestom.server.event.GlobalEventHandler;
import net.minestom.server.event.player.PlayerTickEvent;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

@FieldDefaults(level = AccessLevel.PRIVATE, makeFinal = true)
public class PlayerFallDamageModule extends GameModule {

    Map<UUID, FallData> playerFallData = new HashMap<>();

    public PlayerFallDamageModule(JediCraft jediCraft, GlobalEventHandler globalEventHandler) {
        super(jediCraft);

        globalEventHandler.addListener(PlayerTickEvent.class, event -> {
            JediPlayer jediPlayer = (JediPlayer) event.getPlayer();
            UUID playerId = jediPlayer.getUuid();

            FallData fallData = playerFallData.get(playerId);

            boolean isOnGround = jediPlayer.isOnGround();
            double yVelocity = jediPlayer.getVelocity().y();
            Pos position = jediPlayer.getPosition();

            if (fallData == null) {
                if (!isOnGround && yVelocity < 0) {
                    playerFallData.put(playerId, new FallData(position.y()));
                }
            } else {
                if (isOnGround) {
                    double fallDistance = fallData.startY - position.y();
                    if (fallDistance > 3) {
                        float damage = (float) ((fallDistance - 3) * 1.25);
                        if (damage > 0) {
                            jediPlayer.damage(DamageType.FALL, damage);
                            User user = jediPlayer.getUser();
                            user.setLastHealth(jediPlayer.getHealth());
                        }
                    }
                    playerFallData.remove(playerId);
                } else if (yVelocity >= 0) {
                    playerFallData.remove(playerId);
                }
            }
        });
    }

    public record FallData(double startY) {
    }
}