Utilisation et contraintes

Refuse la capture si l’entité a un autre propriétaire, est temporaire ou ne peut être restaurée sûrement. null signifie seulement que cette règle ne s’y oppose pas ; cela ne contourne pas les exclusions des joueurs ou entités non sûres.

NebulaCreatureCaptureRule

NebulaCreatureCaptureRule
package dev.nebulastorage.api.platform

import net.minecraft.world.entity.Mob

enum class CreatureCaptureRestriction { EXTERNAL_OWNER, TEMPORARY_ENTITY, UNSUPPORTED_STATE }

/**
 * Additional veto before capture and restitution, evaluated on the server thread without mutating the mob or loading chunks.
 * Null means this rule has no objection, not that the entity's external state has been certified.
 * A rule cannot override Nebula's UUID, payload, passenger, raid or persistence checks.
 */
fun interface NebulaCreatureCaptureRule {
    fun restriction(mob: Mob): CreatureCaptureRestriction?
}
Source

src/main/kotlin/dev/nebulastorage/api/platform/NebulaCreatureCaptureRule.kt; editorial/fr.json

43b4d12d69e6033c24fa8c39dac383ef2429b446