Interface ConfiguredFeature

All Superinterfaces:
Keyed, Wrapper
All Known Subinterfaces:
ComposedConfiguredFeature, CustomComposedConfiguredFeature<C>, ReferencedConfiguredFeature

@NullMarked @AsOf("2.3.0") public interface ConfiguredFeature extends Wrapper, Keyed
A configured feature is a feature that has been configured with a specific configuration. Configured features are used to generate features in the world and are tied to biomes.
Since:
2.3.0
See Also:
  • Method Details

    • resourceKey

      @AsOf("3.0.0") Optional<ResourceKey> resourceKey()
      The resource key of the configured feature, if present.
      Returns:
      the resource key of the configured feature, if present
      Since:
      3.0.0
    • of

      @AsOf("2.3.0") @Obsolete static ComposedConfiguredFeature of(FeatureType featureType, FeatureConfiguration config)
      Authors a configured feature from a vanilla feature type and configuration.
      Parameters:
      featureType - the vanilla feature type
      config - the configuration
      Returns:
      an authored configured feature
      Since:
      2.3.0
    • custom

      @AsOf("3.0.0") static <C> CustomComposedConfiguredFeature<C> custom(CustomFeature<C> feature, C config)
      Composes a custom feature with a config instance.
      Type Parameters:
      C - the config type
      Parameters:
      feature - the custom feature to compose
      config - the config instance to place with
      Returns:
      an authored configured feature
      Since:
      3.0.0
    • of

      @AsOf("3.0.0") @Obsolete static <C> CustomComposedConfiguredFeature<C> of(CustomFeature<C> feature, C config)
      Composes a registered custom feature with a config instance.
      Type Parameters:
      C - the config type
      Parameters:
      feature - the custom feature to compose
      config - the config instance to place with
      Returns:
      an authored configured feature
      Since:
      3.0.0
    • reference

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

      @AsOf("3.3.0") @Experimental default ConfiguredFeature wrap()
      Resolves this object's key in Minecraft's configured-feature registry and decodes the registered value.
      Returns:
      the decoded configured feature
      Throws:
      IllegalStateException - if this object has no resource key
      Since:
      3.3.0
    • composed

      @AsOf("3.0.0") static ComposedConfiguredFeature.Builder composed()
      Authors a configured feature from a vanilla feature type and configuration.
      Returns:
      an authored configured feature
      Since:
      3.0.0
    • custom

      @AsOf("3.0.0") static <C> CustomComposedConfiguredFeature.Builder<C> custom()
      Composes a registered custom feature with a config instance. The feature
      Type Parameters:
      C - the config type
      Returns:
      an authored configured feature
      Since:
      3.0.0
    • decode

      @AsOf("3.3.0") static ConfiguredFeature decode(Object minecraftFeature)
      Reads a keyed Minecraft configured-feature holder into a wrapper.
      Parameters:
      minecraftFeature - the configured-feature holder to read
      Returns:
      the wrapper for the configured feature
      Since:
      3.3.0