int r = 5; //this is the radius of the fire
for(int x = 0; x < r; x++) //this "creates" the x coördinate
{
for(int y = 0; y < r; y++) //this "creates" the y coördinate
{
for(int z = 0; z < r; z++) //this "creates" the z coördinate
{
int a = worldObj.getBlockId(this.xTile + x, this.yTile + y, this.zTile + z); // our coördinates
if(a == 0) //if our coördinates are air
{
worldObj.setBlock(this.xTile + x, this.yTile + y, this.zTile + z, Block.fire.blockID); //create fire
setEntityDead(); //remove the entity
}
}
}
}
Thanks for the help but I can't seem to find
if(this.inGround) {
, might it be
if(inGround)
{
?
So then, do I copy the code over everything else that is underneath
I had a mod back in Beta 1.8.1, but I quit for a while so it hasn't been updated since then. WTF <-- If you'd like to try and update it, let me know. (It won't be an easy task, I'm sure)
well my healthblock works... a little exept it heals me OVER max health so i cant get hurt...
package net.minecraft.src;
public class mod_HealthBlock extends BaseMod //Note It extends basemod (part of modloader) not block
{
public static final Block HealthBlock; //Static? Thats new, just go with it okay?
static
{
HealthBlock = (new HealthBlock(102, ModLoader.addOverride("/terrain.png", "/Fizzey's Extras/HealthBlock.png"))).setHardness(500F).setStepSound(Block.soundStoneFootstep).setBlockName("HealthBlock");
} //Those are the properties, should be familiar
public mod_HealthBlock()
{
ModLoader.AddName(HealthBlock, "HealthBlock"); //This is setting the ingame hover name.
ModLoader.RegisterBlock(HealthBlock); //Don't question, just do
ModLoader.AddRecipe(new ItemStack(HealthBlock, 1), new Object[] {
"!X!", "X#X", "!X!", Character.valueOf('X'), Item.redstone, Character.valueOf('#'), Block.torchRedstoneActive, Character.valueOf('!'), Block.blockDiamond
});
}
public String Version()
{
return "1.5_01";
}
}
package net.minecraft.src;
public class HealthBlock extends Block
{
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k)
{
float f = 0.0625F;
return AxisAlignedBB.getBoundingBoxFromPool((float)i + f, j, (float)k + f, (float)(i + 1) - f, (float)(j + 1) - f, (float)(k + 1) - f);
}
public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int i, int j, int k)
{
float f = 0.0625F;
return AxisAlignedBB.getBoundingBoxFromPool((float)i + f, j, (float)k + f, (float)(i + 1) - f, j + 1, (float)(k + 1) - f);
}
public void onEntityCollidedWithBlock(World world, int i, int j, int k, Entity entity)
{
entity.attackEntityFrom(null, -4);
}
protected HealthBlock(int i, int j)
{
super(i, j, Material.rock);
}
}
Just add a small if statement so it looks like this:
public void onEntityCollidedWithBlock(World world, int i, int j, int k, Entity entity)
{
entity.attackEntityFrom(null, -4);
if (entity.health > entity.maxHealth)
entity.health = entity.maxHealth;
}
I'm not 100% sure about this code because I'm just guessing at the variable names, but it should be something like that.
I prefer not to look at video tutorials. There is no point you wont learn unless your brain/eyes see want you want to do and looking at text is much easier then staring at a 10+ minute video.
I prefer not to look at video tutorials. There is no point you wont learn unless your brain/eyes see want you want to do and looking at text is much easier then staring at a 10+ minute video.
Different people learn differently. I actually find that video and actual lectures are better for my learning than reading a book or other text. If you're the opposite, then I'm sure there are plenty of text tutorials. In fact, I'm fairly certain that Oracle has basic Java tutorials on their website.
Rollback Post to RevisionRollBack
I had a mod back in Beta 1.8.1, but I quit for a while so it hasn't been updated since then. WTF <-- If you'd like to try and update it, let me know. (It won't be an easy task, I'm sure)
== MCP v4.3 ==
> Recompiling client...
javac.exe -g -verbose -classpath "lib/;lib/*;jars/bin/minecraft.jar;jars/bin/jin
put.jar;jars/bin/lwjgl.jar;jars/bin/lwjgl_util.jar" -sourcepath src/minecraft -d
bin/minecraft src/minecraft\net\minecraft\client\*.java src/minecraft\net\minec
raft\isom\*.java src/minecraft\net\minecraft\src\*.java conf/patches/*.java fai
led.
Return code : 1
== ERRORS FOUND ==
src\minecraft\net\minecraft\src\mod_SuperArmor.java:45: error: cannot find symbo
l
ModLoader.SetInGameHooks(this, true, false);
^
symbol: method SetInGameHooks(mod_SuperArmor,boolean,boolean)
location: class ModLoader
src\minecraft\net\minecraft\src\mod_SuperArmor.java:65: error: cannot find symbo
l
minecraft.thePlayer = minecraft.entityPlayer.motionY += 3.0;
^
symbol: variable entityPlayer
location: variable minecraft of type Minecraft
2 errors
==================
> Done in 18.34 seconds
> Recompiling server...
!! Can not find server sources !!
Press any key to continue . . .
I imported
net.minecraft.client.Minecraft
like you said
The word 'set' in 'setInGameHook' should not be capitalized. Not sure about the entityPlayer part.
Maybe try posting your complete code?
Rollback Post to RevisionRollBack
I had a mod back in Beta 1.8.1, but I quit for a while so it hasn't been updated since then. WTF <-- If you'd like to try and update it, let me know. (It won't be an easy task, I'm sure)
So I attempted the Generate A Properties File tutorial but I've hit a problem. When using Strength's code to set IDs I first hit errors about variables not existing(defaultNameHere and idNamehere exept renamed ofc) so I had to put their definitions ("public static int idNameHere;") first (ie before mod_modNameHere's contructor) not last like in the tutorial. Then I am getting this:
Mods loaded: 1
ModLoader Beta 1.7.3
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
If you wish to report this, please copy this entire text and email it to [email protected].
Please include a description of what you did when the error occured.
--- BEGIN ERROR REPORT e9df3db --------
Generated 9/10/11 5:25 PM
Minecraft: Minecraft Beta 1.7.3
OS: Windows 7 (amd64) version 6.1
Java: 1.6.0_27, Sun Microsystems Inc.
VM: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Sun Microsystems Inc.
LWJGL: 2.4.2
OpenGL: GeForce 6150SE nForce 430/PCI/SSE2 version 2.1.2, NVIDIA Corporation
java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at net.minecraft.src.ModLoader.addMod(ModLoader.java:224)
at net.minecraft.src.ModLoader.readFromClassPath(ModLoader.java:1022)
at net.minecraft.src.ModLoader.init(ModLoader.java:687)
at net.minecraft.src.ModLoader.AddAllRenderers(ModLoader.java:121)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:65)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:158)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:138)
at net.minecraft.client.Minecraft.run(Minecraft.java:435)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.IllegalArgumentException: Slot 0 is already occupied by net.minecraft.src.BlockRotWood@6a969c29 when adding net.minecraft.src.BlockRotLeaves@45e67e6a
at net.minecraft.src.Block.<init>(Block.java:48)
at net.minecraft.src.Block.<init>(Block.java:75)
at net.minecraft.src.BlockLeavesBase.<init>(BlockLeavesBase.java:16)
at net.minecraft.src.BlockRotLeaves.<init>(BlockRotLeaves.java:10)
at net.minecraft.src.mod_NetherBetter.<clinit>(mod_NetherBetter.java:399)
... 15 more
--- END ERROR REPORT a05869c4 ----------
And I cannot figure out what is the problem. I know it says RotWood is already occupying slot 0 but what IS slot 0? What do I edit to prevent this? Also, for the record the IDs are different so that's not the problem, although the properties code is because this worked fine before I added it.
package net.minecraft.src;
import java.util.Random;
import net.minecraft.client.Minecraft;
public class mod_SuperArmor extends BaseMod
{
public static Item nanoHelmet = (new ItemArmor(420, 6, 5, 0).setItemName("NanoHelmet"));
public static Item nanoBody = (new ItemArmor(421, 6, 5, 1).setItemName("NanoChestPlate"));
public static Item nanoLegs = (new ItemArmor(422, 6, 5, 2).setItemName("NanoLeggings"));
public static Item nanoBoots = (new ItemArmor(423, 6, 5, 3).setItemName("NanoBoots"));
public static final Item nanoFiber = new Item(424).setItemName("nanoFiber");
public static final Item nanoPlate = new Item(425).setItemName("nanoPlate");
public mod_SuperArmor()
{
ModLoader.AddName(nanoHelmet, "NanoHelet");
ModLoader.AddName(nanoBody, "NanoSuit");
ModLoader.AddName(nanoLegs, "NanoLegs");
ModLoader.AddName(nanoBoots, "NanoBoots");
ModLoader.AddName(nanoFiber, "NanoFiber");
ModLoader.AddName(nanoPlate, "NanoPlate");
nanoHelmet.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textures/NanoHelmet.png");
nanoBody.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textures/NanoBody.png");
nanoLegs.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textures/NanoPants.png");
nanoBoots.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textures/NanoBoots.png");
nanoFiber.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textures/NanoFiber.png");
nanoPlate.iconIndex = ModLoader.addOverride("/gui/items.png", "/Textures/NanoPlate.png");
ModLoader.AddRecipe(new ItemStack(mod_SuperArmor.nanoHelmet, 1), new Object[] {"XXX", "X X", " ", Character.valueOf('X'), mod_SuperArmor.nanoPlate,});
ModLoader.AddRecipe(new ItemStack(mod_SuperArmor.nanoBody, 1), new Object[] {"X X", "XXX", "XXX", Character.valueOf('X'), mod_SuperArmor.nanoPlate,});
ModLoader.AddRecipe(new ItemStack(mod_SuperArmor.nanoLegs, 1), new Object[] {"XXX", "X X", "X X", Character.valueOf('X'), mod_SuperArmor.nanoPlate,});
ModLoader.AddRecipe(new ItemStack(mod_SuperArmor.nanoBoots, 1), new Object[] {" ", "X X", "X X", Character.valueOf('X'), mod_SuperArmor.nanoPlate,});
ModLoader.AddRecipe(new ItemStack(mod_SuperArmor.nanoFiber, 1), new Object[] {"XXX", "XYX", "XXX", Character.valueOf('X'), Item.silk, Character.valueOf('Y'), Item.diamond});
ModLoader.AddRecipe(new ItemStack(mod_SuperArmor.nanoPlate, 1), new Object[] {"XXX", "XXX", " ", Character.valueOf('X'), mod_SuperArmor.nanoFiber,});
ModLoader.setInGameHooks(this, true, false);
ModLoader.AddArmor("nano");
}
public boolean OnTickInGame(Minecraft minecraft)
{
ItemStack boots = minecraft.thePlayer.inventory.armorInventory[0];
ItemStack legs = minecraft.thePlayer.inventory.armorInventory[1];
ItemStack chest = minecraft.thePlayer.inventory.armorInventory[2];
ItemStack helm = minecraft.thePlayer.inventory.armorInventory[3];
if(boots == null || legs == null || chest == null || helm == null)
{
return true;
}
if(boots.itemID == nanoBoots.shiftedIndex && legs.itemID == nanoLegs.shiftedIndex && chest.itemID == nanoBody.shiftedIndex && helm.itemID == nanoHelmet.shiftedIndex)
{
minecraft.thePlayer = minecraft.entityPlayer.motionY += 3.0;
}
}
public String Version()
{
return "0.1";
}
}
still the same errors
Okay, I guess we were both wrong on the spelling. It is capitalized, but there is no 's' at the end.
public static void SetInGameHook(BaseMod basemod, boolean flag, boolean flag1)
That's the method heading.
I'm still not sure about the entityPlayer part, and I won't have time to look into it this weekend.
Rollback Post to RevisionRollBack
I had a mod back in Beta 1.8.1, but I quit for a while so it hasn't been updated since then. WTF <-- If you'd like to try and update it, let me know. (It won't be an easy task, I'm sure)
== MCP v4.3 ==
> Recompiling client...
javac.exe -g -verbose -classpath "lib/;lib/*;jars/bin/minecraft.jar;jars/bin/jin
put.jar;jars/bin/lwjgl.jar;jars/bin/lwjgl_util.jar" -sourcepath src/minecraft -d
bin/minecraft src/minecraft\net\minecraft\client\*.java src/minecraft\net\minec
raft\isom\*.java src/minecraft\net\minecraft\src\*.java conf/patches/*.java fai
led.
Return code : 1
== ERRORS FOUND ==
src\minecraft\net\minecraft\src\mod_SuperArmor.java:13: error: missing method bo
dy, or declare abstract
public static void SetInGameHook(BaseMod basemod, boolean flag, boolean flag1);
^
1 error
==================
> Done in 10.86 seconds
> Recompiling server...
!! Can not find server sources !!
Press any key to continue . . .
Did what both of you said here is the code
public static void SetInGameHook(BaseMod basemod, boolean flag, boolean flag1);
I guess you misunderstood what I said. That's the heading of the method inside of 'ModLoader.java'. You want the name to be the same (which was the problem) and the arguments to correlate directly (which they already did with (this, true, false). You don't need the public static void or the argument types when you call the method.
Rollback Post to RevisionRollBack
I had a mod back in Beta 1.8.1, but I quit for a while so it hasn't been updated since then. WTF <-- If you'd like to try and update it, let me know. (It won't be an easy task, I'm sure)
I guess you misunderstood what I said. That's the heading of the method inside of 'ModLoader.java'. You want the name to be the same (which was the problem) and the arguments to correlate directly (which they already did with (this, true, false). You don't need the public static void or the argument types when you call the method.
Ok but now I get An error that says I'm missing a } even though it's there
== MCP v4.3 ==
> Recompiling client...
javac.exe -g -verbose -classpath "lib/;lib/*;jars/bin/minecraft.jar;jars/bin/jin
put.jar;jars/bin/lwjgl.jar;jars/bin/lwjgl_util.jar" -sourcepath src/minecraft -d
bin/minecraft src/minecraft\net\minecraft\client\*.java src/minecraft\net\minec
raft\isom\*.java src/minecraft\net\minecraft\src\*.java conf/patches/*.java fai
led.
Return code : 1
== ERRORS FOUND ==
src\minecraft\net\minecraft\src\mod_SuperArmor.java:69: error: missing return st
atement
}
^
1 error
==================
> Done in 13.44 seconds
> Recompiling server...
!! Can not find server sources !!
Press any key to continue . . .
I added what I think you need (and a comment to point it out) above.
Rollback Post to RevisionRollBack
I had a mod back in Beta 1.8.1, but I quit for a while so it hasn't been updated since then. WTF <-- If you'd like to try and update it, let me know. (It won't be an easy task, I'm sure)
You have to
Also, check out my YouTube channel: www.YouTube.com/StrongJoshua
Thanks for the help but I can't seem to find , might it be ?
So then, do I copy the code over everything else that is underneath ?
Take some Java tutorials and you might realize that that's effectively the same statement, yes.
Edit: try this one TheNewBoston
I had a mod back in Beta 1.8.1, but I quit for a while so it hasn't been updated since then.
WTF <-- If you'd like to try and update it, let me know. (It won't be an easy task, I'm sure)
Haha, alright, will do.
it seems i was ignored...
Just add a small if statement so it looks like this:
I'm not 100% sure about this code because I'm just guessing at the variable names, but it should be something like that.
Also, check out my YouTube channel: www.YouTube.com/StrongJoshua
I prefer not to look at video tutorials. There is no point you wont learn unless your brain/eyes see want you want to do and looking at text is much easier then staring at a 10+ minute video.
Different people learn differently. I actually find that video and actual lectures are better for my learning than reading a book or other text. If you're the opposite, then I'm sure there are plenty of text tutorials. In fact, I'm fairly certain that Oracle has basic Java tutorials on their website.
I had a mod back in Beta 1.8.1, but I quit for a while so it hasn't been updated since then.
WTF <-- If you'd like to try and update it, let me know. (It won't be an easy task, I'm sure)
and
here is the error code
I imported like you said
The word 'set' in 'setInGameHook' should not be capitalized. Not sure about the entityPlayer part.
Maybe try posting your complete code?
I had a mod back in Beta 1.8.1, but I quit for a while so it hasn't been updated since then.
WTF <-- If you'd like to try and update it, let me know. (It won't be an easy task, I'm sure)
And I cannot figure out what is the problem. I know it says RotWood is already occupying slot 0 but what IS slot 0? What do I edit to prevent this? Also, for the record the IDs are different so that's not the problem, although the properties code is because this worked fine before I added it.
still the same errors
Okay, I guess we were both wrong on the spelling. It is capitalized, but there is no 's' at the end.
That's the method heading.
I'm still not sure about the entityPlayer part, and I won't have time to look into it this weekend.
I had a mod back in Beta 1.8.1, but I quit for a while so it hasn't been updated since then.
WTF <-- If you'd like to try and update it, let me know. (It won't be an easy task, I'm sure)
Do what Rabisu said then change to
Also, check out my YouTube channel: www.YouTube.com/StrongJoshua
Did what both of you said here is the code
I guess you misunderstood what I said. That's the heading of the method inside of 'ModLoader.java'. You want the name to be the same (which was the problem) and the arguments to correlate directly (which they already did with (this, true, false). You don't need the public static void or the argument types when you call the method.
I had a mod back in Beta 1.8.1, but I quit for a while so it hasn't been updated since then.
WTF <-- If you'd like to try and update it, let me know. (It won't be an easy task, I'm sure)
Ok but now I get An error that says I'm missing a } even though it's there
I added what I think you need (and a comment to point it out) above.
I had a mod back in Beta 1.8.1, but I quit for a while so it hasn't been updated since then.
WTF <-- If you'd like to try and update it, let me know. (It won't be an easy task, I'm sure)
Thank you it worked !!!!