Kicking off this account with a help request, and probably a bit of a silly one. Ah well. The mod should be worth it.My setBlock code works fine with vanilla blocks, but when I try and set one of my mod blocks, the game crashes with a NullPointerException. This must be because there isn't a proper ID for it. The tutorial I followed for Block IDs says to use this code:
ModBase.java:
final Block greenFlamesGeneral = new GreenFlamesGeneral(816, Material.fire) .setHardness(0.0F).setStepSound(null) .setUnlocalizedName("greenflamesgeneral").setCreativeTab(CreativeTabs.tabMisc);
GreenFlamesGeneral.java:
public class GreenFlamesGeneral extends Block{public GreenFlamesGeneral(int id, Material par2Material) { super(id, par2Material); }}
Unrelated code has been left out
Please could somebody tell me where I've gone wrong?Any other things I should be changing would be highly appreciated.
I have made an unofficial port of the spectacular ExRollerCoaster mod, updated for Minecraft 1.12.2.
Build wonderful roller coasters which can go in ANY direction, and the camera will twist and turn with you.
I'm not releasing it through the usual channels but I hope four years on this site makes me a trustworthy modder.
Links:
First I wouldn't use final in the block declaration...
in the public class YourMod I would use this
public static greenFlamesGeneral;
then in your load section use ...
greenFlamesGeneral= new GreenFlamesGeneral(816, Material.fire).setHardness(0.0F).setStepSound(null) .setUnlocalizedName("greenflamesgeneral").setCreativeTab(CreativeTabs.tabMisc);
Not sure what else you have in the mod class but dont forget to register your blocks as well
I have made an unofficial port of the spectacular ExRollerCoaster mod, updated for Minecraft 1.12.2.
Build wonderful roller coasters which can go in ANY direction, and the camera will twist and turn with you.
I'm not releasing it through the usual channels but I hope four years on this site makes me a trustworthy modder.
Links:
I have made an unofficial port of the spectacular ExRollerCoaster mod, updated for Minecraft 1.12.2.
Build wonderful roller coasters which can go in ANY direction, and the camera will twist and turn with you.
I'm not releasing it through the usual channels but I hope four years on this site makes me a trustworthy modder.
Links:
original mod homepage
source code of my port
download mod jar here
in the public class YourMod I would use this
public static greenFlamesGeneral;
then in your load section use ...
greenFlamesGeneral = new GreenFlamesGeneral(816, Material.fire).setHardness(0.0F).setStepSound(null) .setUnlocalizedName("greenflamesgeneral").setCreativeTab(CreativeTabs.tabMisc);
Not sure what else you have in the mod class but dont forget to register your blocks as well
Find out how I generate....coolAlias...world structure generation and rotation tool...
I have made an unofficial port of the spectacular ExRollerCoaster mod, updated for Minecraft 1.12.2.
Build wonderful roller coasters which can go in ANY direction, and the camera will twist and turn with you.
I'm not releasing it through the usual channels but I hope four years on this site makes me a trustworthy modder.
Links:
original mod homepage
source code of my port
download mod jar here
Find out how I generate....coolAlias...world structure generation and rotation tool...