提供: Minecraft Modding Wiki
この編集を取り消せます。
下記の差分を確認して、本当に取り消していいか検証してください。よろしければ変更を保存して取り消しを完了してください。
最新版 | 編集中の文章 | ||
1行目: | 1行目: | ||
{{前提MOD|reqmod="Minecraft Forge Universal 9.10.0.xxx~"}} | {{前提MOD|reqmod="Minecraft Forge Universal 9.10.0.xxx~"}} | ||
− | + | ||
− | + | ==アイテムの追加== | |
<p>簡単なアイテムの追加方法</p> | <p>簡単なアイテムの追加方法</p> | ||
− | + | ||
− | |||
===ソースコード=== | ===ソースコード=== | ||
*SampleItemCore.java | *SampleItemCore.java | ||
18行目: | 17行目: | ||
import cpw.mods.fml.common.registry.LanguageRegistry; | import cpw.mods.fml.common.registry.LanguageRegistry; | ||
− | @Mod(modid=SampleItemCore | + | @Mod(modid="SampleItemCore", name="SampleItemCore", version="1.0") |
public class SampleItemCore | public class SampleItemCore | ||
{ | { | ||
− | |||
− | |||
− | |||
public static Item sampleItem; | public static Item sampleItem; | ||
− | |||
public static int sampleItemID = 28520; | public static int sampleItemID = 28520; | ||
62行目: | 57行目: | ||
this.setCreativeTab(CreativeTabs.tabMaterials); //クリエイティブのタブ | this.setCreativeTab(CreativeTabs.tabMaterials); //クリエイティブのタブ | ||
this.setUnlocalizedName("SampleItem"); //システム名の登録 | this.setUnlocalizedName("SampleItem"); //システム名の登録 | ||
− | this. | + | this.func_111206_d("samplemod:sample_item"); //テクスチャの指定 |
this.setMaxStackSize(64); //スタックできる量 | this.setMaxStackSize(64); //スタックできる量 | ||
} | } | ||
86行目: | 81行目: | ||
} | } | ||
</source> | </source> | ||
− | |||
==解説== | ==解説== | ||
===SampleItemCore.java=== | ===SampleItemCore.java=== | ||
117行目: | 111行目: | ||
this.setCreativeTab(CreativeTabs.tabMaterials); //クリエイティブのタブ | this.setCreativeTab(CreativeTabs.tabMaterials); //クリエイティブのタブ | ||
this.setUnlocalizedName("SampleItem"); //システム名の登録 | this.setUnlocalizedName("SampleItem"); //システム名の登録 | ||
− | this. | + | this.func_111206_d("samplemod:sample_item"); //テクスチャの指定 |
this.setMaxStackSize(64); //スタックできる量 | this.setMaxStackSize(64); //スタックできる量 | ||
</source> | </source> |