注意:1.4.5 的更新内容量较大,页面上很可能仍有内容尚未更新。
如中文 wiki 信息过时,可以参考英文 wiki 对应页面。
见 Terraria Wiki:项目/1.4.5 获取 wiki 状态与更新指南
如中文 wiki 信息过时,可以参考英文 wiki 对应页面。
见 Terraria Wiki:项目/1.4.5 获取 wiki 状态与更新指南
Template:NpcIdFromName
跳转到导航
跳转到搜索
This template returns the NPC ID of an NPC based on its name. It requires the exact name of the NPC, with potential sub-names in parentheses (e.g. Kobold Glider (T3)).
Usage
{{ npcIdFromName | <NPC name> }}
- First unnamed parameter
Name of the NPC.
Notes
Since worms consist of several NPCs with different IDs, lacking a result for their trivial name, the ID of the worm's head will be returned when using its trivial name. Requesting Wyvern, for instance, results in 87, while the Wyvern's single NPC IDs are as follows:
| Wyvern Head | 87 |
| Wyvern Legs | 88 |
| Wyvern Body | 89 |
| Wyvern Body 2 | 90 |
| Wyvern Body 3 | 91 |
| Wyvern Tail | 92 |
The same applies to other NPCs that share a name, such as the variants of the Old One's Army's enemies in the different tiers. Check the source code of this template to make sure it produces no unexpected results.
Examples
| Code | Result |
|---|---|
{{npcIdFromName|Eye of Cthulhu}} |
4 |
{{npcIdFromName|Sand Poacher (On Wall)}} |
531 |
See also
- {{npcNameFromId}}