Interface ContainmentData

All Known Implementing Classes:
ContainmentDataHolder

public interface ContainmentData
Represents containment data for living entities affected by the containment effect. This data is used by the Shrine structure and Containment spell to restrict entity movement within a specific area.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable net.minecraft.core.BlockPos
    Gets the containment position for the containment effect, used for the Shrine structure and Containment spell.
    net.minecraft.world.entity.LivingEntity
    Gets the living entity that this containment data is associated with.
    void
    setContainmentPos(@Nullable net.minecraft.core.BlockPos pos)
    Sets the containment position for the containment effect, used for the Shrine structure and Containment spell.
  • Method Details

    • getProvider

      net.minecraft.world.entity.LivingEntity getProvider()
      Gets the living entity that this containment data is associated with.
      Returns:
      the living entity provider
    • getContainmentPos

      @Nullable @Nullable net.minecraft.core.BlockPos getContainmentPos()
      Gets the containment position for the containment effect, used for the Shrine structure and Containment spell.
      Returns:
      The BlockPos representing the containment position, or null if not contained.
    • setContainmentPos

      void setContainmentPos(@Nullable @Nullable net.minecraft.core.BlockPos pos)
      Sets the containment position for the containment effect, used for the Shrine structure and Containment spell.
      Parameters:
      pos - The BlockPos to set as the containment position, or null to clear it.