Interface Datapack


@NullMarked public interface Datapack
This is a snapshot of a datapack on the server. It won't be updated as datapacks are updated.
  • Method Details

    • getName

      @Contract(pure=true) String getName()
      Gets the name/id of this datapack.
      Returns:
      the name of the pack
    • getTitle

      Component getTitle()
      Gets the title component of this datapack.
      Returns:
      the title
    • getDescription

      Component getDescription()
      Gets the description component of this datapack.
      Returns:
      the description
    • isRequired

      boolean isRequired()
      Gets if this datapack is required to be enabled.
      Returns:
      true if the pack is required
    • getCompatibility

      Datapack.Compatibility getCompatibility()
      Gets the compatibility status of this pack.
      Returns:
      the compatibility of the pack
    • getRequiredFeatures

      @Unmodifiable Set<FeatureFlag> getRequiredFeatures()
      Gets the set of required features for this datapack.
      Returns:
      the set of required features
    • isEnabled

      boolean isEnabled()
      Gets the enabled state of this pack.
      Returns:
      whether the pack is currently enabled
    • setEnabled

      void setEnabled(boolean enabled)
      Changes the enabled state of this pack. Will cause a reload of resources (/minecraft:reload) if any change happens.
      Parameters:
      enabled - true to enable, false to disable
      API Note:
      This method may be deprecated in the future as setters on a "snapshot" type are undesirable.
    • getSource

      DatapackSource getSource()
      Gets the source for this datapack.
      Returns:
      the pack source
    • computeDisplayName

      @Contract(pure=true, value="-> new") Component computeDisplayName()
      Computes the component vanilla Minecraft uses to display this datapack. Includes the getSource(), getDescription(), getName(), and the enabled state.
      Returns:
      a new component