Interface PlacedFeature

All Superinterfaces:
Keyed, Wrapper
All Known Implementing Classes:
PlacedFeature.Composed, PlacedFeature.Reference

@NullMarked @AsOf("2.3.0") public sealed interface PlacedFeature extends Wrapper, Keyed permits PlacedFeature.Reference, PlacedFeature.Composed
Wraps Minecraft's PlacedFeature, a configured feature paired with the ordered list of placement modifiers applied to it. A placed feature may either reference one already present in the PLACED_FEATURE registry, or be authored from a configured feature plus a list of modifiers.
Since:
2.3.0
  • Method Details

    • toMinecraft

      @AsOf("2.3.0") default Object toMinecraft()
      Converts this placed feature to a Minecraft object.
      Specified by:
      toMinecraft in interface Wrapper
      Returns:
      a Minecraft object representing this placed feature
      Since:
      2.3.0
    • toBuilder

      default PlacedFeature.Builder toBuilder()
      Converts this object to a builder.
      Returns:
      a builder with the same values as this object
      Since:
      2.3.0
    • reference

      @AsOf("2.3.0") static PlacedFeature.Reference reference(ResourceKey key)
      References a placed feature already registered under the given key.
      Parameters:
      key - the registry key of the placed feature
      Returns:
      a reference to the registered placed feature
      Since:
      2.3.0
    • wrap

      @AsOf("3.3.0") @Experimental default PlacedFeature wrap()
      Resolves this object's key in Minecraft's placed-feature registry and decodes the registered value.
      Returns:
      the decoded placed feature
      Since:
      3.3.0
    • of

      @AsOf("2.3.0") static PlacedFeature.Composed of(ConfiguredFeature feature, List<PlacementModifier> placements)
      Authors a placed feature from a configured feature and a list of modifiers.
      Parameters:
      feature - the configured feature to place
      placements - the ordered placement modifiers
      Returns:
      an authored placed feature
      Since:
      2.3.0
    • of

      @AsOf("2.3.0") static PlacedFeature.Composed of(ConfiguredFeature feature, PlacementModifier... placements)
      Authors a placed feature from a configured feature and a list of modifiers.
      Parameters:
      feature - the configured feature to place
      placements - the ordered placement modifiers
      Returns:
      an authored placed feature
      Since:
      2.3.0
    • builder

      @AsOf("2.3.0") static PlacedFeature.Builder builder()
      Creates a new builder.
      Returns:
      a new builder
      Since:
      2.3.0
    • decode

      @AsOf("3.3.0") static PlacedFeature decode(Object minecraftPlacedFeature)
      Reads a keyed Minecraft placed-feature holder into a reference wrapper.
      Parameters:
      minecraftPlacedFeature - the placed-feature holder to read
      Returns:
      a reference to the placed feature
      Since:
      3.3.0