📜  我的世界块java代码示例

📅  最后修改于: 2022-03-11 14:52:14.138000             🧑  作者: Mango

代码示例1
public class ModBlocks {
    //defferedRegistry
    public static final DeferredRegister BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, modclass.MOD_ID);
    //and now the registerobject of a block
    public static final RegistryObject NAME_BLOCK = BLOCKS.register("name_block", () -> new Block(Block.Properties.create(Material.MATERIAL).sound(SoundType.SOUND).hardnessAndResistance(hardness, resistance)));
    //replace NAME_BLOCK by the name of your block (always in caps) same with the register but with no caps
      //replace MATERIAL by the material name, replace SOUND with the sound name , replace hardness with the Float of hardness value, replace resistance with Float of resistance value
      //you can allways add more things for proprieties
}