
AspectsLib
Library mod that adds data-driven Aspects from Thaumcraft, allowing to attach Aspects to entities and create unique interactions between them.
869
1
Список изменений
Made changes to hide aspects in tooltips by default while allowing developers to customize when they're shown.
Key Changes:
- Hidden by default: Aspects won't show in tooltips unless explicitly enabled
- Flexible conditions: Developers can add multiple visibility conditions
- Player context: Conditions have access to player state and inventory
- Easy to use: Simple API for adding custom conditions
- Non-intrusive: Doesn't require changes to existing item/entity code
Usage Examples:
- Always show aspects:
AspectsTooltipConfig.setAlwaysShow(true);
- Show only when holding a specific item:
AspectsTooltipConfig.addVisibilityCondition((stack, player) -> {
if (player == null) return false;
return player.getMainHandStack().isOf(Items.GOLD_INGOT);
});
- Show only in creative mode:
AspectsTooltipConfig.addVisibilityCondition((stack, player) -> {
return player != null && player.isCreative();
});
- Show only when sneaking:
AspectsTooltipConfig.addVisibilityCondition((stack, player) -> {
return player != null && player.isSneaking();
});
- 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;
});
Метаданные
Канал релиза
Release
Номер версии
1.0.5
Загрузчики
Fabric
Версии игры
1.20.1
Загрузок
69
Дата публикации
8 мес. назад
