JavaScript is disabled on your browser.
Record Components:
id - The unique identifier of the quest (used in files, network packets, and save states).
title - The human-readable title displayed in screens and tooltips.
category - The name of the tab/category this quest belongs to.
icon - The ItemStack rendered as the visual icon for the quest node.
displayX - The X coordinate of the quest node on the visual canvas.
displayY - The Y coordinate of the quest node on the visual canvas.
parents - The list of prerequisite quest IDs that must be completed before unlocking this quest.
properties - A key-value map containing arbitrary metadata (such as custom descriptions).
tasks - The list of objectives that must be satisfied to complete this quest.
rewards - The list of rewards granted to the player upon claiming this quest.
public record QuestDefinition (
String id,
String title,
String category, net.minecraft.world.item.ItemStack icon, int displayX, int displayY,
List <
String > parents,
Map <
String ,
String > properties, List <QuestTask > tasks, List <QuestReward > rewards)
extends Record
Represents the immutable static configuration and metadata of a quest.
A quest is an aggregate holding display metadata, an extensible list of tasks (objectives),
an extensible list of rewards, and arbitrary properties/descriptions.
Constructor Summary
Constructors
QuestDefinition (String id,
String title,
String category,
net.minecraft.world.item.ItemStack icon,
int displayX,
int displayY,
List <String > parents,
Map <String ,String > properties,
List <QuestTask > tasks,
List <QuestReward > rewards)
Creates an instance of a QuestDefinition record class.
Method Summary
All Methods Static Methods Instance Methods Concrete Methods
Returns the value of the
category record component.
Factory helper to create a concrete
QuestReward instance based on a type enum.
Returns the general description of this quest stored in its properties map.
int
Returns the value of the
displayX record component.
int
Returns the value of the
displayY record component.
final boolean
Indicates whether some other object is "equal to" this one.
final int
Returns a hash code value for this object.
net.minecraft.world.item.ItemStack
Returns the value of the
icon record component.
Returns the value of the
id record component.
Returns the value of the
parents record component.
Returns the first reward of the quest, or a default fallback reward if none exist.
Returns the first task of the quest, or a default fallback task if none exist.
Returns the value of the
properties record component.
int
Returns the required amount to fulfill the primary task.
Returns the target identifier of the primary reward (item ID or command string).
int
Returns the numerical amount of the primary reward.
Returns the human-readable description of the primary reward if applicable.
Returns the value of the
rewards record component.
Returns the reward type of the primary reward.
Returns the target string (e.g.
Returns the value of the
tasks record component.
Returns the task type of the primary task.
Returns the value of the
title record component.
Returns a string representation of this record class.
Creates a copy of this quest moved into a different category.
Creates a copy of this quest with a new ID and title.
Creates a copy of this quest with updated canvas coordinates.
Constructor Details
QuestDefinition
public QuestDefinition (String id,
String title,
String category,
net.minecraft.world.item.ItemStack icon,
int displayX,
int displayY,
List <String > parents,
Map <String ,String > properties,
List <QuestTask > tasks,
List <QuestReward > rewards)
Creates an instance of a QuestDefinition record class.
Parameters:
id - the value for the id record component
title - the value for the title record component
category - the value for the category record component
icon - the value for the icon record component
displayX - the value for the displayX record component
displayY - the value for the displayY record component
parents - the value for the parents record component
properties - the value for the properties record component
tasks - the value for the tasks record component
rewards - the value for the rewards record component
Method Details
withPosition
Creates a copy of this quest with updated canvas coordinates.
Parameters:
newX - The new X coordinate on the visual canvas.
newY - The new Y coordinate on the visual canvas.
Returns:
A new QuestDefinition with updated position.
withIdAndTitle
Creates a copy of this quest with a new ID and title.
Parameters:
newId - The new unique identifier.
newTitle - The new display title.
Returns:
A new QuestDefinition with updated ID and title.
withCategory
Creates a copy of this quest moved into a different category.
Parameters:
newCategory - The target category name.
Returns:
A new QuestDefinition placed in the target category.
createReward
Factory helper to create a concrete
QuestReward instance based on a type enum.
Parameters:
type - The RewardType category.
target - The target identifier (item ID or command string).
amount - The reward quantity or count.
description - A custom description for command rewards.
Returns:
A concrete QuestReward instance.
primaryTask
Returns the first task of the quest, or a default fallback task if none exist.
Returns:
The primary QuestTask .
primaryReward
Returns the first reward of the quest, or a default fallback reward if none exist.
Returns:
The primary QuestReward .
taskType
Returns the task type of the primary task.
Returns:
The TaskType .
target
Returns the target string (e.g. block ID, mob ID) of the primary task.
Returns:
The target string.
requiredAmount
public int requiredAmount ()
Returns the required amount to fulfill the primary task.
Returns:
The required amount integer.
rewardType
Returns the reward type of the primary reward.
Returns:
The RewardType .
reward
Returns the target identifier of the primary reward (item ID or command string).
Returns:
The target identifier string.
rewardAmount
public int rewardAmount ()
Returns the numerical amount of the primary reward.
Returns:
The reward amount.
rewardDescription
public String rewardDescription ()
Returns the human-readable description of the primary reward if applicable.
Returns:
The reward description string.
description
Returns the general description of this quest stored in its properties map.
Returns:
The quest description string.
toString
public final String toString ()
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
Specified by:
toString in class Record
Returns:
a string representation of this object
hashCode
public final int hashCode ()
Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
Specified by:
hashCode in class Record
Returns:
a hash code value for this object
equals
public final boolean equals (Object o)
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with
Objects::equals(Object,Object); primitive components are compared with '=='.
Specified by:
equals in class Record
Parameters:
o - the object with which to compare
Returns:
true if this object is the same as the o argument; false otherwise.
id
Returns the value of the
id record component.
Returns:
the value of the id record component
title
Returns the value of the
title record component.
Returns:
the value of the title record component
category
Returns the value of the
category record component.
Returns:
the value of the category record component
icon
public net.minecraft.world.item.ItemStack icon ()
Returns the value of the
icon record component.
Returns:
the value of the icon record component
displayX
public int displayX ()
Returns the value of the
displayX record component.
Returns:
the value of the displayX record component
displayY
public int displayY ()
Returns the value of the
displayY record component.
Returns:
the value of the displayY record component
parents
Returns the value of the
parents record component.
Returns:
the value of the parents record component
properties
Returns the value of the
properties record component.
Returns:
the value of the properties record component
tasks
Returns the value of the
tasks record component.
Returns:
the value of the tasks record component
rewards
Returns the value of the
rewards record component.
Returns:
the value of the rewards record component