Effect Lore Display
Effect Lore Display
Learn how to customize the way effects are displayed in item lore, including visibility controls, formatting, and display limits.
Overview
zItems provides fine-grained control over how effects appear in item lore. You can:
Control visibility of base effects vs additional effects
Limit the number of effects shown
Customize formatting using messages
Show "And More..." when effects are truncated
Separate base lore from effect lore
Display Settings
Per-Item Settings
Configure in your item YAML files (items/*.yml):
id: "my_pickaxe"
# ... other settings ...
# Effect Display Control
nb-effects-view: -1 # How many effects to show
base-effects-visible: true # Show base effects
additional-effects-visible: true # Show added effectsnb-effects-view
Controls how many effects are displayed in lore:
-1
Show all effects (no limit)
0
Show no effects (hide all)
> 0
Show up to N effects, then "And More..."
Examples:
base-effects-visible
Controls whether effects defined in the item config are shown:
Base effects are those defined in the effects: list in the item YAML.
additional-effects-visible
Controls whether effects added via commands are shown:
Additional effects are those applied using /zitems effect apply.
Global Default Settings
Configure in config.yml:
This applies to all items that don't specify nb-effects-view in their YAML.
Lore Formatting
Effect lore is formatted using the messages system. Customize in messages.yml:
Message Placeholders
effects-lore-line
The <effect> placeholder is replaced with the effect's display-name from the effect YAML:
Effect YAML:
Result in lore:
How Lore Generation Works
During Item Build
When an item is first created (/zitems item give):
Base lore is added from
lore:in item YAMLEffect lore is generated based on
base-effects-visibleandnb-effects-viewBoth are combined and applied to the item
Effects are stored in PDC (PersistentDataContainer)
Implementation: ZItem.java:build()
When Effects are Applied
When effects are added via /zitems effect apply:
Effect is added to PDC
Lore is recalculated:
Base effects = original effects from config
Additional effects = effects in PDC not in base
Effect lore is regenerated based on visibility settings
Item lore is updated: base lore + new effect lore
Implementation: ZEffectsManager.java:updateItemLoreWithEffects()
Lore Update Flow
Examples
Show All Effects
Result:
Hide All Effects
Result:
No effect lore is shown at all.
Limit to 2 Effects
Result:
The "And More..." line indicates there are additional effects not shown.
Show Base Only
Result after adding Vein Miner:
Vein Miner is NOT shown because additional-effects-visible: false.
Show Additional Only
Result initially:
No effects shown because only base effect exists.
After adding Vein Miner:
Only the added effect is shown.
Custom Formatting
Rainbow Effect List
Result:
Minimalist Style
Result:
Detailed Style
Result:
Vanilla Items
Effects can be applied to vanilla items using /zitems effect apply (while holding the item).
Vanilla Item Lore Handling
For vanilla items:
Existing lore is preserved
Effect section is added below existing lore
If effects are updated, old effect section is replaced
Example:
Result:
Technical Details
Lore Separation
Custom Items:
Base lore is stored in
ItemSettings.lore()Effect lore is generated on-demand
Combined during
build()andupdateItemLoreWithEffects()
Vanilla Items:
Existing lore is scanned for effect section
Effect section identified by
Messages.EFFECTS_LORE_TITLEOld effect section removed before adding new one
Effect Order
Effects are displayed in the order they appear:
Base effects (if
base-effects-visible: true)Additional effects (if
additional-effects-visible: true)
Within each group, effects are in the order they were added.
PDC Storage
All effects (base + additional) are stored in PersistentDataContainer:
Key:
Keys.EFFECTSType:
List<Effect>Serialized using
ZEffectDataType
The distinction between base and additional is recalculated each time by comparing PDC effects with the item config.
Troubleshooting
Effect lore not showing
Check:
Is
nb-effects-viewset to0? (Hides all effects)Is
base-effects-visibleoradditional-effects-visiblefalse?Does the effect have a
display-namein its YAML?
Debug:
Look for: [zItems] [DEBUG] Updated item lore for <item> with <N> total effects
Lore duplicated
Cause: Calling updateItemLoreWithEffects() multiple times without clearing previous lore.
Solution: This is handled automatically by zItems. If you're using the API:
"And More..." not showing
Check:
Is
nb-effects-viewset correctly? (Must be > 0 and < total effects)Do you have more effects than the limit?
Example:
Won't show "And More..." because there's only 1 effect (less than limit).
Custom formatting not applying
Check:
Did you edit
messages.yml?Did you
/zitems reloadafter editing?Are you using valid MiniMessage syntax?
Test:
If it still doesn't work, check for YAML syntax errors:
API Usage
Updating Lore Programmatically
Generating Effect Lore
The generation logic is in ZEffectsManager.java:
Best Practices
Use
-1for normal items - Show all effects unless you have a reason to hide themUse
0for mystery items - Hide effects for surprise mechanicsUse limits for items with many effects - Prevents lore from becoming too long
Keep effect names concise - Long display names can wrap awkwardly
Test with many effects - Ensure lore doesn't overflow (Minecraft has lore limits)
Use consistent formatting - Edit
messages.ymlfor server-wide style
Related Documentation
Effects System - How effects work
Creating Items - Item configuration
Configuration - Global settings
Effect Handlers Reference - All available effects
Need help? Join our Discord or check GitHub Issues!
Last updated