King Spider(蛛王)
事实基准:
/Users/evlos/a/mirror/twilightforest(minecraftVersion = 1.7.10)逐行读源码。
基本信息
| 属性 | 值 | 来源 |
|---|---|---|
| 注册实体名 | TwilightForest:King Spider |
TwilightForestMod.java:616-621 |
| 实体 ID 常量 | idMobKingSpider = 212 |
TwilightForestMod.java:1114 |
| 类 | twilightforest.entity.EntityTFKingSpider |
entity/EntityTFKingSpider.java(114 行) |
| 父类 | net.minecraft.entity.monster.EntitySpider |
同上 :17 |
| 尺寸 | setSize(1.6F, 1.6F) |
同上 :22 |
模型缩放 spiderScaleAmount |
1.9F | 同上 :71-73 |
阴影缩放 getRenderSizeModifier |
2.0F | 同上 :79-81 |
| 蛋色 | 主 0x2c1a0e / 副 0xffc017 |
TwilightForestMod.java:620-621 |
| 所属结构 | 暗之森林群系(TFBiomeDarkForest) |
biomes/TFBiomeDarkForest.java:62 |
数值
| 属性 | 值 | 来源 |
|---|---|---|
maxHealth |
30.0 | EntityTFKingSpider.java:51 |
movementSpeed |
0.35 | 同上 :52 |
attackDamage |
6.0 | 同上 :53 |
| 索敌半径 | 16.0 格 | 同上 :63-64 |
| 跳跃距离系数 | 0.3F(EntityAILeapAtTarget) |
同上 :28 |
| 游荡速度 | 0.2F | 同上 :29 |
| 观察距离 | 6.0F | 同上 :30 |
| 骑乘 Y 偏移 | height * 0.5D |
同上 :110-112 |
生成权重
biomes/TFBiomeDarkForest.java:62:spawnableMonsterList
中 SpawnListEntry(EntityTFKingSpider.class, 10, 1, 4)
—— 权重 10,群体 1–4 只(注意它的同群系邻居 Twilight Kobold 是 4–8,:63)。
没有 TFFeature.addMonster 条目,即不出现在任何结构里,只在暗之森林群系自然刷出。
AI 行为 / 特殊机制
isAIEnabled() 恒为 true(:40-43)。任务表(:25-33):
| 优先级 | 任务 | 行号 |
|---|---|---|
| 2 | EntityAIAttackOnCollide(EntityPlayer, 1.0D, false) |
:27 |
| 3 | EntityAILeapAtTarget(this, 0.3F) |
:28 |
| 6 | EntityAIWander(this, 0.2F) |
:29 |
| 7 | EntityAIWatchClosest(EntityPlayer, 6.0F) |
:30 |
| 8 | EntityAILookIdle |
:31 |
targetTasks:EntityAIHurtByTarget(优先级 2)与
EntityAINearestAttackableTarget(EntityPlayer, 0, true)(优先级 2)(:32-33)。
白天也攻击:覆写 findPlayerToAttack 固定 16 格索敌,去掉原版白天判定(:60-65)。
避水:getNavigator().setAvoidsWater(true)(:25)。
不会爬梯:isOnLadder() 恒返回 false(:86-89),源码注释 // let's not climb。
永远骑骷髅:覆写 onSpawnWithEgg,无条件生成一只 EntityTFSkeletonDruid
并让它 mountEntity(this)(:94-105,注释 // always a spider jockey)。
所以用刷怪蛋生成出来的 King Spider 一定骑着骷髅。
骑乘时 getMountedYOffset() 返回自身高度的一半(:110-112)。
未实装部分:tasks.addTask(1, new EntityAITFChargeAttack(this, 0.4F))
被注释(:26);this.moveSpeed = 0.35F; 也被注释(:23),
移速实际来自 applyEntityAttributes 的 movementSpeed。
掉落:本类没有 dropFewItems / getDropItem 覆写,
沿用 EntitySpider 默认的线与羊毛,不掉落 TwilightForest 物品。
相关条目
- Twilight Kobold(暮色狗头人) - 同在暗之森林群系刷出
- Hedge Spider(树篱蜘蛛) - 另一种被改成全天敌对的蜘蛛
- 暮色森林世界生成特性(TFFeature) - 本实体不属于任何结构