更改

添加1,031字节 、 2024年9月11日 (星期三)
无编辑摘要
第13行: 第13行:     
 模组最佳做法:
 
 模组最佳做法:
 +
 +
* Use namespaced IDs prefixed with your [[Modding:Modder Guide/APIs/Manifest#Basic fields|mod's unique ID]]. For example, if your mod ID is <code>Example.PufferchickMod</code> and you're adding a pufferchick plushy, your item ID would look like <code>Example.PufferchickMod_PufferchickPlushy</code>. In a [[Modding:Content Patcher|Content Patcher pack]], you can use <code><nowiki>{{ModId}}_PufferchickPlushy</nowiki></code> to insert your mod ID automatically.
 +
* Only use alphanumeric (a–z, A–Z, 0–9), underscore (<code>_</code>), and dot (<code>.</code>) characters in string IDs. This is important because they're often used in places where some characters have special meaning (like file names or [[#Game state query|game state queries]]).
 +
 +
Although the game generally doesn't validate the ID format, you're '''strongly encouraged''' to use this exact format to maintain good mod compatibility, eliminate ID conflicts, and make it easy (for both troubleshooters and mod code) to identify which mod added custom content.
    
[[Category:模组]]
 
[[Category:模组]]
    
[[en:Modding:Common data field types]]
 
[[en:Modding:Common data field types]]
67

个编辑