# Via command
/zitems effect apply super_hammer
# Via smithing table
# Use effect representation items
id: "my_pickaxe"
material: DIAMOND_PICKAXE
effects:
- hammer
- vein_miner
- auto_sell
# Display control
nb-effects-view: -1 # -1=all, 0=none, >0=limit
base-effects-visible: true # Show base effects
additional-effects-visible: true # Show added effects
# Effect restrictions
allow-additional-effects: true # Can add more effects
disabled-effects: # Cannot add these
- "silk_spawner"
default-nb-effects-view: -1 # Default for all items
effects-lore-header: "" # Empty line before
effects-lore-title: "<gray>Effects" # Section title
effects-lore-line: "<dark_gray>- <effect>" # Each effect
effects-lore-more: "<dark_gray>- <white>And More..." # When limited
Super Pickaxe
Effects
- ⚒ HAMMER
- 🔥 AUTO SMELT
- And More...
@AutoEffect("HAMMER")
public class Hammer
implements EffectHandler.SingleEventEffectHandler<HammerSettings, BlockBreakEvent> {
// ...
}
@AutoEffect("AUTO_SELL")
public class AutoSell
implements EffectHandler.MultiEventEffectHandler<AutoSellSettings> {
@Override
public Set<Class<? extends Event>> eventTypes() {
return Set.of(BlockBreakEvent.class, EntityDeathEvent.class);
}
}
@AutoEffect("UNBREAKABLE")
public class Unbreakable
implements EffectHandler.NoEventEffectHandler<EmptySettings> {
@Override
public void handle(EffectContext context, EmptySettings settings) {
context.itemSource().editMeta(meta -> {
meta.setUnbreakable(true);
});
}
}
1. Event fires (BlockBreakEvent)
2. Extract ItemStack from event
3. Load effects from item's PDC
4. Create EffectContext
5. Find handlers for this event type
6. Sort handlers by priority
7. Execute each handler sequentially
8. Apply final state (break blocks, drop items)
public interface EffectContext {
Event event(); // The trigger event
Player executor(); // The player
ItemStack itemSource(); // The item
List<ItemStack> drops(); // Accumulated drops
Set<Block> affectedBlocks(); // Blocks to break
void addDrop(ItemStack drop); // Add a drop
void addDrops(Collection<ItemStack> drops);
}
1. Hammer: Finds blocks in 3x3 area, adds to affectedBlocks
2. Melt Mining: Converts ore drops to smelted versions
3. Auto-Sell: Sells the smelted drops
4. Final: Break blocks, spawn remaining drops
@AutoEffect("HAMMER")
@IncompatibleWith(VeinMiner.class)
public class Hammer { }
@AutoEffect("VEIN_MINING")
@IncompatibleWith(Hammer.class)
public class VeinMiner { }
/zitems effect apply vein_miner
# If item has Hammer:
# → "Effect vein_miner is incompatible with existing effects"