Package valorless.rarespawns.datamodels
Class ItemData
java.lang.Object
valorless.rarespawns.datamodels.ItemData
Immutable data container describing a RareSpawns item definition parsed from its YAML file.
Each public field corresponds (loosely) to a configuration key or group of keys. The builder
layer (ItemBuilder / ItemCreator) reads these values to construct a runtime ItemStack.
This object is not intended to be mutated after construction; most collections are created
eagerly (never null) to simplify downstream code. Absent/disabled features remain null where
distinction from an empty collection is meaningful (e.g., customModelData).
The update flag indicates whether existing in-game items referencing this definition
are eligible for automatic rebuild via updateItem logic.
-
Field Summary
FieldsModifier and TypeFieldDescriptionStack amount (amount).HashMap<org.bukkit.attribute.Attribute, org.bukkit.attribute.AttributeModifier> Attribute modifiers (attributes).Banner patterns (banner-patterns).Written book content (written-book.*).Sound to play when the item is broken (sounds.break).final valorless.valorlessutils.config.ConfigUnderlying loaded configuration (for advanced inspection / debugging).1.21.4+ consumable behaviour component (food.* mapped).Sound when consumption completes (food.sound-done).Multiplier for items from crops (drops-multiplier.crops).Custom model data (model-data).Display name shown to players (display-name).Sound to play when the item is dropped (sounds.drop).Max durability override (durability).Hex dyed color (dyed).Sound to play on egg throw (egg.sound).Enchantments (enchants).Equippable component (equippable.*).Experience dropped when caught via fishing (fishing.exp-drop).Apply lure effect when fishing with this item (fishing.apply-lure).Maximum lure angle (degrees) for hook spread (fishing.lure-angle.max).Minimum lure angle (degrees) for hook spread (fishing.lure-angle.min).Maximum lure time in ticks (fishing.lure-time.max).Minimum lure time in ticks (fishing.lure-time.min).Whether rain influences catch timing (fishing.rain-influenced).Whether open sky influences catch timing (fishing.sky-influenced).Sound when a fish bites (fishing.sound-bite).Sound when casting the line (fishing.sound-cast).Sound when a catch is collected (fishing.sound-caught).Maximum wait time before a bite in ticks (fishing.wait-time.max).Minimum wait time before a bite in ticks (fishing.wait-time.min).org.bukkit.inventory.meta.components.FoodComponentFood component (food.*).Glider flag (equippable.glider).Multiplier for items obtained via harvesting (drops-multiplier.harvested).Hatch flag (egg.hatch).Number of entities to hatch (egg.amount).Entity type to hatch (egg.type).Base64 head texture (head-texture).Hide vanilla tooltip (hide-tooltip).final StringThe internal id (filename stem) assigned after load.List<org.bukkit.inventory.ItemFlag> Item flags (item-flags).Custom item model (item-model).Raw internal name (item-name).Knowledge book recipe key (knowledge-book).Localised / parsed lore lines (lore).org.bukkit.MaterialBase material (material).Max stack size override (max-stack).Already consumed durability / damage value (missing-durability).NBT values to inject (nbt).Sound to play when the item is picked up (sounds.pickup).org.bukkit.inventory.meta.components.JukeboxPlayableComponentJukebox playable component (playable.*).Potion effects (potion-effects).Power item component (poweritem.*).Rarity (rarity).Shear multiplier for items obtained via shearing (drops-multiplier.shearing).Soulbound flag (soulbound).Soul Harvester component (soul-harvester.*).When set, this item functions as a "soulstone" that can spawn entities (soulstone.entity).Sound played when the soulstone is used (soulstone.sound).Current / initial spawner delay in ticks (spawner.delay).Maximum delay between spawn cycles in ticks (spawner.max-spawn-delay).Maximum nearby entities before spawning pauses (spawner.max-nearby-entities).Minimum delay between spawn cycles in ticks (spawner.min-spawn-delay).Number of entities spawned per cycle (spawner.spawn-count).Entity type the spawner will produce (spawner.type).Stored book enchantments (stored-enchantments).Custom tags (tags).org.bukkit.inventory.meta.components.ToolComponentTool component (tool.*).Tooltip style key (tooltip-style).When true, this item functions as a totem of resurrection (totem.resurrect).When true, the totem must be in the player's main or off hand to function (totem.held).Optional sound to play when the totem triggers (totem.sound).Armor trim material (trim.material).Armor trim pattern (trim.pattern).Unbreakable flag (unbreakable).final booleanWhether updateItem should rebuild instances of this item (config key: update-item).Use cooldown component (use-cooldown.*).org.bukkit.inventory.ItemStackRemainder item after use (use-remainder). -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
config
public final valorless.valorlessutils.config.Config configUnderlying loaded configuration (for advanced inspection / debugging). -
update
public final boolean updateWhether updateItem should rebuild instances of this item (config key: update-item). -
id
The internal id (filename stem) assigned after load. -
itemName
Raw internal name (item-name). -
displayName
Display name shown to players (display-name). -
lore
Localised / parsed lore lines (lore). Never null. -
material
public org.bukkit.Material materialBase material (material). -
amount
Stack amount (amount). -
maxStack
Max stack size override (max-stack). -
customModelData
Custom model data (model-data). -
itemModel
Custom item model (item-model). -
durability
Max durability override (durability). -
missingDurability
Already consumed durability / damage value (missing-durability). -
unbreakable
Unbreakable flag (unbreakable). -
hideTooltip
Hide vanilla tooltip (hide-tooltip). -
rarity
Rarity (rarity). -
enchants
Enchantments (enchants). Never null. -
attributes
Attribute modifiers (attributes). Never null. -
itemFlags
Item flags (item-flags). Never null. -
nbt
NBT values to inject (nbt). Never null. -
tags
Custom tags (tags). Never null. -
food
public org.bukkit.inventory.meta.components.FoodComponent foodFood component (food.*). -
consumable
1.21.4+ consumable behaviour component (food.* mapped). -
consumeSound
Sound when consumption completes (food.sound-done). -
tool
public org.bukkit.inventory.meta.components.ToolComponent toolTool component (tool.*). -
playable
public org.bukkit.inventory.meta.components.JukeboxPlayableComponent playableJukebox playable component (playable.*). -
useCooldown
Use cooldown component (use-cooldown.*). -
equippable
Equippable component (equippable.*). -
glider
Glider flag (equippable.glider). -
useRemainder
public org.bukkit.inventory.ItemStack useRemainderRemainder item after use (use-remainder). -
powerItem
Power item component (poweritem.*). -
soulHarvester
Soul Harvester component (soul-harvester.*). -
headTexture
Base64 head texture (head-texture). -
trimPattern
Armor trim pattern (trim.pattern). -
trimMaterial
Armor trim material (trim.material). -
dyedColor
Hex dyed color (dyed). -
bannerPatterns
Banner patterns (banner-patterns). Never null. -
potionEffects
Potion effects (potion-effects). Never null. -
storedEnchants
Stored book enchantments (stored-enchantments). Never null. -
tooltipStyle
Tooltip style key (tooltip-style). -
soulbound
Soulbound flag (soulbound). -
knowledgeBook
Knowledge book recipe key (knowledge-book). -
book
Written book content (written-book.*). -
hatch
Hatch flag (egg.hatch). -
hatchType
Entity type to hatch (egg.type). -
hatchAmount
Number of entities to hatch (egg.amount). -
eggSound
Sound to play on egg throw (egg.sound). -
cropsMultiplier
Multiplier for items from crops (drops-multiplier.crops). -
harvestedMultiplier
Multiplier for items obtained via harvesting (drops-multiplier.harvested). -
shearMultiplier
Shear multiplier for items obtained via shearing (drops-multiplier.shearing). -
spawnerType
Entity type the spawner will produce (spawner.type). -
spawnerSpawnCount
Number of entities spawned per cycle (spawner.spawn-count). -
spawnerDelay
Current / initial spawner delay in ticks (spawner.delay). -
spawnerMinDelay
Minimum delay between spawn cycles in ticks (spawner.min-spawn-delay). -
spawnerMaxDelay
Maximum delay between spawn cycles in ticks (spawner.max-spawn-delay). -
spawnerMaxNearbyEntities
Maximum nearby entities before spawning pauses (spawner.max-nearby-entities). -
pickupSound
Sound to play when the item is picked up (sounds.pickup). -
dropSound
Sound to play when the item is dropped (sounds.drop). -
breakSound
Sound to play when the item is broken (sounds.break). -
fishingExp
Experience dropped when caught via fishing (fishing.exp-drop). -
fishingLure
Apply lure effect when fishing with this item (fishing.apply-lure). -
fishingLureAngleMin
Minimum lure angle (degrees) for hook spread (fishing.lure-angle.min). -
fishingLureAngleMax
Maximum lure angle (degrees) for hook spread (fishing.lure-angle.max). -
fishingLureTimeMin
Minimum lure time in ticks (fishing.lure-time.min). -
fishingLureTimeMax
Maximum lure time in ticks (fishing.lure-time.max). -
fishingWaitTimeMin
Minimum wait time before a bite in ticks (fishing.wait-time.min). -
fishingWaitTimeMax
Maximum wait time before a bite in ticks (fishing.wait-time.max). -
fishingRainInfluenced
Whether rain influences catch timing (fishing.rain-influenced). -
fishingSkyInfluenced
Whether open sky influences catch timing (fishing.sky-influenced). -
fishingSoundCast
Sound when casting the line (fishing.sound-cast). -
fishingSoundBite
Sound when a fish bites (fishing.sound-bite). -
fishingSoundCaught
Sound when a catch is collected (fishing.sound-caught). -
totem
When true, this item functions as a totem of resurrection (totem.resurrect). -
totemHeld
When true, the totem must be in the player's main or off hand to function (totem.held). -
totemSound
Optional sound to play when the totem triggers (totem.sound). -
soulstone
When set, this item functions as a "soulstone" that can spawn entities (soulstone.entity). -
soulstoneSound
Sound played when the soulstone is used (soulstone.sound).
-
-
Constructor Details
-
ItemData
Constructs the data model from a loaded configuration. Only the update flag is interpreted here; all other fields are populated later by the builder pipeline.- Parameters:
config- source configuration file wrapper
-