AspectsLib (1.0.5)

Changelog

Made changes to hide aspects in tooltips by default while allowing developers to customize when they're shown.

Key Changes:

  1. Hidden by default: Aspects won't show in tooltips unless explicitly enabled
  2. Flexible conditions: Developers can add multiple visibility conditions
  3. Player context: Conditions have access to player state and inventory
  4. Easy to use: Simple API for adding custom conditions
  5. Non-intrusive: Doesn't require changes to existing item/entity code

Usage Examples:

  1. Always show aspects:
AspectsTooltipConfig.setAlwaysShow(true);
  1. Show only when holding a specific item:
AspectsTooltipConfig.addVisibilityCondition((stack, player) -> {
    if (player == null) return false;
    return player.getMainHandStack().isOf(Items.GOLD_INGOT);
});
  1. Show only in creative mode:
AspectsTooltipConfig.addVisibilityCondition((stack, player) -> {
    return player != null && player.isCreative();
});
  1. Show only when sneaking:
AspectsTooltipConfig.addVisibilityCondition((stack, player) -> {
    return player != null && player.isSneaking();
});
  1. Complex condition (show when holding compass and in overworld):
AspectsTooltipConfig.addVisibilityCondition((stack, player) -> {
    if (player == null) return false;
    return player.getMainHandStack().isOf(Items.COMPASS) && 
           player.getWorld().getRegistryKey() == World.OVERWORLD;
});

Files

AspectsLib-1.0.5.jar(166.6 KiB) Primary Download
AspectsLib-1.0.5-sources.jar(120.6 KiB) Download

Details

Licensed MIT
Published a month ago
Updated 2 days ago