Package io.papermc.paper.datapack
Interface Datapack
This is a snapshot of a datapack on the server. It
won't be updated as datapacks are updated.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionComputes the component vanilla Minecraft uses to display this datapack.Gets the compatibility status of this pack.Gets the description component of this datapack.getName()
Gets the name/id of this datapack.Gets the set of required features for this datapack.Gets the source for this datapack.getTitle()
Gets the title component of this datapack.boolean
Gets the enabled state of this pack.boolean
Gets if this datapack is required to be enabled.void
setEnabled
(boolean enabled) Changes the enabled state of this pack.
-
Method Details
-
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
Computes the component vanilla Minecraft uses to display this datapack. Includes thegetSource()
,getDescription()
,getName()
, and the enabled state.- Returns:
- a new component
-