Interface Datapack

All Superinterfaces:
DiscoveredDatapack

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

    • 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.
    • computeDisplayName

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