Crystal Leveling 图标

Crystal Leveling

作者:rebot | 分类:模组

价格:0 墨喵币 下载量:0 点赞:0 版本 1.0
本资源为搬运资源,原资源地址: https://modrinth.com/mod/crystal-leveling
资源信息

Minecraft 版本: 1.20.1

平台: forge

标签: adventure game-mechanics mobs

资源介绍

When a entity spawns or joins the world, this mod dynamically assigns it a random “difficulty level” from 1 to 100 and then buffs its stats based on that level. The mob’s display name is then appended with a colored crystal icon that serves as a visual tier/rarity indicator of how tough it is.

So players will encounter mobs with increased:

  • Max health
  • Attack damage
  • Armor
  • Armor toughness

Scaled by that random difficulty level.
Their name gets a suffix icon with a color code representing how high the difficulty is (e.g., green for low, colorful for top tier), making it easy to spot stronger-than-normal mobs at a glance.

Example(from lowest to highest):

 

For devs

The mod defines a syncable difficulty_level attribute (0–100) and attaches it to all entities. Other mods can read that attribute and branch logic (e.g., custom drops, loot tiers, effects) based on its value.

@Mod.EventBusSubscriber
public class CustomDropOnDeathWithTiers {
    @SubscribeEvent
    public static void onLivingDeath(net.minecraftforge.event.entity.living.LivingDeathEvent event) {
        LivingEntity entity = event.getEntityLiving();
        if (entity == null)
            return;

        // Read difficulty level (default to 0 if missing)
        double difficulty = 0;
        if (entity.getAttributes().hasAttribute(CrystalLevelingModAttributes.DIFFICULTY_LEVEL.get())) {
            difficulty = entity.getAttribute(CrystalLevelingModAttributes.DIFFICULTY_LEVEL.get()).getBaseValue();
        }

        // Determine tier and give corresponding drop
        if (difficulty >= 81) {
            // Top tier (colorful): very rare reward
            entity.spawnAtLocation(new ItemStack(Items.NETHER_STAR), 0.0F);
        } else if (difficulty >= 65) {
            // Dark blue tier: rare reward
            entity.spawnAtLocation(new ItemStack(Items.DIAMOND), 0.0F);
        } else if (difficulty >= 49) {
            // Light purple tier: uncommon reward
            entity.spawnAtLocation(new ItemStack(Items.EMERALD), 0.0F);
        } else if (difficulty >= 33) {
            // Red tier: modest reward
            entity.spawnAtLocation(new ItemStack(Items.IRON_INGOT), 0.0F);
        } else if (difficulty >= 17) {
            // Yellow tier: common reward
            entity.spawnAtLocation(new ItemStack(Items.GOLD_INGOT), 0.0F);
        } else {
            // Green tier: baseline reward
            entity.spawnAtLocation(new ItemStack(Items.APPLE), 0.0F);
        }
    }
}
下载太慢?试试 墨喵加速站,支持 Modrinth 和外网直链高速下载! 用的人越多,下载的越快!
下载与版本
评论(0)
登录 后发表评论。

暂无评论,抢个沙发吧~

举报此资源

请登录后举报

🔥 相关推荐
Simple Timer

价格:0 墨喵币
下载量:0

查看详情
Scorched Guns Brass

价格:0 墨喵币
下载量:0

查看详情
Glow Ink Sack Recipe

价格:0 墨喵币
下载量:0

查看详情
Cooperative Advancements

价格:0 墨喵币
下载量:0

查看详情