The Meaning of Life, the Universe, and Everything.
Location:
Earth
Join Date:
7/7/2015
Posts:
128
Location:
Earth
Minecraft:
prdxcl
Discord:
Paradoxical#2936
Member Details
EDIT: Changed code a little to prevent errors, suggested by Bright_Spark
EDIT(2): Removed BREAK statements
Yes. Add this code to the bottom of the class, and I believe it should work in 1.8:
@Override
public ItemStack getCurrentArmor(int slotIn) {
switch(slotIn) {
case 103 /*helmet*/:
return new ItemStack(Items.IRON_HELMET);
case 102 /*chestplate*/:
return new ItemStack(Items.IRON_HELMET)
case 101 /*leggings*/:
return null;
case 100 /*boots*/:
return null;
default:
return null;
}
}
That will throw an error that the method isn't always returning a value. You'll want to change that so that it'll return null by default.
No it shouldn't because he is returning null in the default statement of his switch.
Please remove the breakes after your return statements because they're redundant.
No it shouldn't because he is returning null in the default statement of his switch.
Please remove the breakes after your return statements because they're redundant.
The code for my entity is above, may someone please help me with my question?
I mainly want this mob to spawn with armor such as an iron chestplate and helmet. How could I do this?
I appreciate any and all help!
What version are you using? The code has changed between versions.
I am a mod maker. Check out my mods:
1.7.10 is the version of the code above.
However, could you show me my code in 1.8 please?
EDIT: Changed code a little to prevent errors, suggested by Bright_Spark
EDIT(2): Removed BREAK statements
Yes. Add this code to the bottom of the class, and I believe it should work in 1.8:
I am a mod maker. Check out my mods:
That will throw an error that the method isn't always returning a value. You'll want to change that so that it'll return null by default.
No it shouldn't because he is returning null in the default statement of his switch.
Please remove the breakes after your return statements because they're redundant.
Nice Greetings
TechMage
Ah, he edited it to correct it after my post.
Thank you all so much for the help! You guys are awesome