Class ItemData

java.lang.Object
valorless.rarespawns.datamodels.ItemData

public class ItemData extends Object
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 Details

    • config

      public final valorless.valorlessutils.config.Config config
      Underlying loaded configuration (for advanced inspection / debugging).
    • update

      public final boolean update
      Whether updateItem should rebuild instances of this item (config key: update-item).
    • id

      public final String id
      The internal id (filename stem) assigned after load.
    • itemName

      public String itemName
      Raw internal name (item-name).
    • displayName

      public String displayName
      Display name shown to players (display-name).
    • lore

      public List<String> lore
      Localised / parsed lore lines (lore). Never null.
    • material

      public org.bukkit.Material material
      Base material (material).
    • amount

      public Integer amount
      Stack amount (amount).
    • maxStack

      public Integer maxStack
      Max stack size override (max-stack).
    • customModelData

      public Integer customModelData
      Custom model data (model-data).
    • itemModel

      public String itemModel
      Custom item model (item-model).
    • durability

      public Integer durability
      Max durability override (durability).
    • missingDurability

      public Integer missingDurability
      Already consumed durability / damage value (missing-durability).
    • unbreakable

      public Boolean unbreakable
      Unbreakable flag (unbreakable).
    • hideTooltip

      public Boolean hideTooltip
      Hide vanilla tooltip (hide-tooltip).
    • rarity

      public String rarity
      Rarity (rarity).
    • enchants

      public HashMap<org.bukkit.enchantments.Enchantment,Integer> enchants
      Enchantments (enchants). Never null.
    • attributes

      public HashMap<org.bukkit.attribute.Attribute,org.bukkit.attribute.AttributeModifier> attributes
      Attribute modifiers (attributes). Never null.
    • itemFlags

      public List<org.bukkit.inventory.ItemFlag> itemFlags
      Item flags (item-flags). Never null.
    • nbt

      public HashMap<String,NBTData> nbt
      NBT values to inject (nbt). Never null.
    • tags

      public HashMap<org.bukkit.NamespacedKey,TagData> tags
      Custom tags (tags). Never null.
    • food

      public org.bukkit.inventory.meta.components.FoodComponent food
      Food component (food.*).
    • consumable

      public Consumable consumable
      1.21.4+ consumable behaviour component (food.* mapped).
    • consumeSound

      public Sound consumeSound
      Sound when consumption completes (food.sound-done).
    • tool

      public org.bukkit.inventory.meta.components.ToolComponent tool
      Tool component (tool.*).
    • playable

      public org.bukkit.inventory.meta.components.JukeboxPlayableComponent playable
      Jukebox playable component (playable.*).
    • useCooldown

      public Cooldown useCooldown
      Use cooldown component (use-cooldown.*).
    • equippable

      public Equippable equippable
      Equippable component (equippable.*).
    • glider

      public Boolean glider
      Glider flag (equippable.glider).
    • useRemainder

      public org.bukkit.inventory.ItemStack useRemainder
      Remainder item after use (use-remainder).
    • powerItem

      public PowerItemComponent powerItem
      Power item component (poweritem.*).
    • soulHarvester

      public SoulHarvesterComponent soulHarvester
      Soul Harvester component (soul-harvester.*).
    • headTexture

      public String headTexture
      Base64 head texture (head-texture).
    • trimPattern

      public String trimPattern
      Armor trim pattern (trim.pattern).
    • trimMaterial

      public String trimMaterial
      Armor trim material (trim.material).
    • dyedColor

      public String dyedColor
      Hex dyed color (dyed).
    • bannerPatterns

      public List<String> bannerPatterns
      Banner patterns (banner-patterns). Never null.
    • potionEffects

      public List<String> potionEffects
      Potion effects (potion-effects). Never null.
    • storedEnchants

      public List<String> storedEnchants
      Stored book enchantments (stored-enchantments). Never null.
    • tooltipStyle

      public String tooltipStyle
      Tooltip style key (tooltip-style).
    • soulbound

      public Boolean soulbound
      Soulbound flag (soulbound).
    • knowledgeBook

      public String knowledgeBook
      Knowledge book recipe key (knowledge-book).
    • book

      public WrittenBook book
      Written book content (written-book.*).
    • hatch

      public Boolean hatch
      Hatch flag (egg.hatch).
    • hatchType

      public String hatchType
      Entity type to hatch (egg.type).
    • hatchAmount

      public Integer hatchAmount
      Number of entities to hatch (egg.amount).
    • eggSound

      public Sound eggSound
      Sound to play on egg throw (egg.sound).
    • cropsMultiplier

      public Double cropsMultiplier
      Multiplier for items from crops (drops-multiplier.crops).
    • harvestedMultiplier

      public Double harvestedMultiplier
      Multiplier for items obtained via harvesting (drops-multiplier.harvested).
    • shearMultiplier

      public Double shearMultiplier
      Shear multiplier for items obtained via shearing (drops-multiplier.shearing).
    • spawnerType

      public String spawnerType
      Entity type the spawner will produce (spawner.type).
    • spawnerSpawnCount

      public Integer spawnerSpawnCount
      Number of entities spawned per cycle (spawner.spawn-count).
    • spawnerDelay

      public Integer spawnerDelay
      Current / initial spawner delay in ticks (spawner.delay).
    • spawnerMinDelay

      public Integer spawnerMinDelay
      Minimum delay between spawn cycles in ticks (spawner.min-spawn-delay).
    • spawnerMaxDelay

      public Integer spawnerMaxDelay
      Maximum delay between spawn cycles in ticks (spawner.max-spawn-delay).
    • spawnerMaxNearbyEntities

      public Integer spawnerMaxNearbyEntities
      Maximum nearby entities before spawning pauses (spawner.max-nearby-entities).
    • pickupSound

      public Sound pickupSound
      Sound to play when the item is picked up (sounds.pickup).
    • dropSound

      public Sound dropSound
      Sound to play when the item is dropped (sounds.drop).
    • breakSound

      public Sound breakSound
      Sound to play when the item is broken (sounds.break).
    • fishingExp

      public Integer fishingExp
      Experience dropped when caught via fishing (fishing.exp-drop).
    • fishingLure

      public Boolean fishingLure
      Apply lure effect when fishing with this item (fishing.apply-lure).
    • fishingLureAngleMin

      public Integer fishingLureAngleMin
      Minimum lure angle (degrees) for hook spread (fishing.lure-angle.min).
    • fishingLureAngleMax

      public Integer fishingLureAngleMax
      Maximum lure angle (degrees) for hook spread (fishing.lure-angle.max).
    • fishingLureTimeMin

      public Integer fishingLureTimeMin
      Minimum lure time in ticks (fishing.lure-time.min).
    • fishingLureTimeMax

      public Integer fishingLureTimeMax
      Maximum lure time in ticks (fishing.lure-time.max).
    • fishingWaitTimeMin

      public Integer fishingWaitTimeMin
      Minimum wait time before a bite in ticks (fishing.wait-time.min).
    • fishingWaitTimeMax

      public Integer fishingWaitTimeMax
      Maximum wait time before a bite in ticks (fishing.wait-time.max).
    • fishingRainInfluenced

      public Boolean fishingRainInfluenced
      Whether rain influences catch timing (fishing.rain-influenced).
    • fishingSkyInfluenced

      public Boolean fishingSkyInfluenced
      Whether open sky influences catch timing (fishing.sky-influenced).
    • fishingSoundCast

      public Sound fishingSoundCast
      Sound when casting the line (fishing.sound-cast).
    • fishingSoundBite

      public Sound fishingSoundBite
      Sound when a fish bites (fishing.sound-bite).
    • fishingSoundCaught

      public Sound fishingSoundCaught
      Sound when a catch is collected (fishing.sound-caught).
    • totem

      public Boolean totem
      When true, this item functions as a totem of resurrection (totem.resurrect).
    • totemHeld

      public Boolean totemHeld
      When true, the totem must be in the player's main or off hand to function (totem.held).
    • totemSound

      public Sound totemSound
      Optional sound to play when the totem triggers (totem.sound).
    • soulstone

      public String soulstone
      When set, this item functions as a "soulstone" that can spawn entities (soulstone.entity).
    • soulstoneSound

      public Sound soulstoneSound
      Sound played when the soulstone is used (soulstone.sound).
  • Constructor Details

    • ItemData

      public ItemData(valorless.valorlessutils.config.Config config, String id)
      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