[answered] Help with crashing
3 posters
MC Modding :: Help :: Help
Page 1 of 1
[answered] Help with crashing
I made a block using your tutorial and it is supposed to heal you. but when i touch it, it changes minecraft to a saving chunks screen and then minecraft crashes. why is this?
Admin Edit: Please use proper topic format. I'll fix for you.
Admin Edit: Please use proper topic format. I'll fix for you.
Last edited by the undecided t on Mon Oct 24, 2011 2:55 pm; edited 1 time in total
Re: [answered] Help with crashing
Please post code and error. In order to get the error run minecraft in error mode.
Static_boy123- Helper
- Posts : 32
Join date : 2011-10-19
Age : 25
Location : Eclipse Indigo
Re: [answered] Help with crashing
it doesnt give me an error when i start it would error mode still work?
- Code:
package net.minecraft.src;
import java.util.Random;
public class Blockcocopad extends Block
{
public Blockcocopad(int i, int j)
{
super(i, j, Material.iron);
}
public int idDropped(int i, Random random)
{
return mod_Coco.cocopad.blockID;
}
public int quantityDropped(Random random)
{
return 0;
}
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, -1);
}
}
Re: [answered] Help with crashing
here is the error --- BEGIN ERROR REPORT 37488 --------
Generated 10/20/11 8:29 PM
Minecraft: Minecraft Beta 1.8.1
OS: Windows 7 (amd64) version 6.1
Java: 1.7.0, Oracle Corporation
VM: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
LWJGL: 2.4.2
OpenGL: Mobile Intel(R) 4 Series Express Chipset Family version 2.1.0 - Build 8.15.10.1883, Intel
java.lang.NullPointerException
at net.minecraft.src.EntityPlayer.attackEntityFrom(EntityPlayer.java:594)
at net.minecraft.src.Blockcocopad.onEntityCollidedWithBlock(Blockcocopad.java:32)
at net.minecraft.src.Entity.moveEntity(Entity.java:506)
at net.minecraft.src.EntityPlayerSP.moveEntity(EntityPlayerSP.java:44)
at net.minecraft.src.EntityLiving.moveEntityWithHeading(EntityLiving.java:600)
at net.minecraft.src.EntityPlayer.moveEntityWithHeading(EntityPlayer.java:1056)
at net.minecraft.src.EntityLiving.onLivingUpdate(EntityLiving.java:753)
at net.minecraft.src.EntityPlayer.onLivingUpdate(EntityPlayer.java:353)
at net.minecraft.src.EntityPlayerSP.onLivingUpdate(EntityPlayerSP.java:193)
at net.minecraft.src.EntityLiving.onUpdate(EntityLiving.java:255)
at net.minecraft.src.EntityPlayer.onUpdate(EntityPlayer.java:163)
at net.minecraft.src.World.updateEntityWithOptionalForce(World.java:1558)
at net.minecraft.src.World.updateEntity(World.java:1534)
at net.minecraft.src.World.updateEntities(World.java:1442)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1157)
at net.minecraft.client.Minecraft.run(Minecraft.java:483)
at java.lang.Thread.run(Thread.java:722)
--- END ERROR REPORT 20dfe49b ----------
Generated 10/20/11 8:29 PM
Minecraft: Minecraft Beta 1.8.1
OS: Windows 7 (amd64) version 6.1
Java: 1.7.0, Oracle Corporation
VM: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
LWJGL: 2.4.2
OpenGL: Mobile Intel(R) 4 Series Express Chipset Family version 2.1.0 - Build 8.15.10.1883, Intel
java.lang.NullPointerException
at net.minecraft.src.EntityPlayer.attackEntityFrom(EntityPlayer.java:594)
at net.minecraft.src.Blockcocopad.onEntityCollidedWithBlock(Blockcocopad.java:32)
at net.minecraft.src.Entity.moveEntity(Entity.java:506)
at net.minecraft.src.EntityPlayerSP.moveEntity(EntityPlayerSP.java:44)
at net.minecraft.src.EntityLiving.moveEntityWithHeading(EntityLiving.java:600)
at net.minecraft.src.EntityPlayer.moveEntityWithHeading(EntityPlayer.java:1056)
at net.minecraft.src.EntityLiving.onLivingUpdate(EntityLiving.java:753)
at net.minecraft.src.EntityPlayer.onLivingUpdate(EntityPlayer.java:353)
at net.minecraft.src.EntityPlayerSP.onLivingUpdate(EntityPlayerSP.java:193)
at net.minecraft.src.EntityLiving.onUpdate(EntityLiving.java:255)
at net.minecraft.src.EntityPlayer.onUpdate(EntityPlayer.java:163)
at net.minecraft.src.World.updateEntityWithOptionalForce(World.java:1558)
at net.minecraft.src.World.updateEntity(World.java:1534)
at net.minecraft.src.World.updateEntities(World.java:1442)
at net.minecraft.client.Minecraft.runTick(Minecraft.java:1157)
at net.minecraft.client.Minecraft.run(Minecraft.java:483)
at java.lang.Thread.run(Thread.java:722)
--- END ERROR REPORT 20dfe49b ----------
Re: [answered] Help with crashing
You`re the guy working on Cocosmackdowns mod .
breakyorself- Member
- Posts : 60
Join date : 2011-10-19
Re: [answered] Help with crashing
that would be a yes... These are the tuts i have been using the whole time. Thanks for recognizing me
Re: [answered] Help with crashing
Edit: ignore this
Last edited by breakyorself on Fri Oct 21, 2011 6:38 am; edited 1 time in total
breakyorself- Member
- Posts : 60
Join date : 2011-10-19
Re: [answered] Help with crashing
Blockcocopad.class =
Plus if it works can i get credit for fixing the bug :3.
- Code:
package net.minecraft.src;
import java.util.Random;
public class Blockcocopad extends Block
{
public Blockcocopad (int i, int j)
{
super(i, j, Material.ground);
}
public int idDropped(int i, Random random)
{
return mod_cocopad.Namehere.blockID;
}
public void onEntityWalking(World world, int x, int y, int z, Entity entity) {
entity.motionY += 5.0;
}
public int quantityDropped(Random random)
{
return 3;
}
}
- Code:
package net.minecraft.src;
public class mod_cocopad extends BaseMod
{
public static Block Namehere = new Blockcocopad(190, 0).setHardness(1.0F).setResistance(6000.0F).setLightValue(1.0F).setBlockName("Namehere");
public String Version()
{
return "1.8.1";
}
public mod_cocopad()
{
ModLoader.RegisterBlock(Namehere);
Namehere.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/cocopad.png");
ModLoader.AddName(Namehere, "Namehere");
ModLoader.AddRecipe(new ItemStack(Namehere, 1), new Object[] {
"###", "###", "###", Character.valueOf('#'), Block.dirt
});
}
}
Plus if it works can i get credit for fixing the bug :3.
breakyorself- Member
- Posts : 60
Join date : 2011-10-19
Re: [answered] Help with crashing
How would i set it to heal though. i am trying to make it heal not bouncy.
Re: [answered] Help with crashing
fail . I thought it was the pad you jumped on cause coco said you get saving chunks if you step on it.
breakyorself- Member
- Posts : 60
Join date : 2011-10-19
Re: [answered] Help with crashing
it is... its gonna allow you to bounce... I might just ditch the healing idea.
Re: [answered] Help with crashing
I`ll try and get some fixed code.
breakyorself- Member
- Posts : 60
Join date : 2011-10-19
Re: [answered] Help with crashing
- Code:
public void onEntityCollidedWithBlock(World world, int i, int j, int k, Entity entity)
{
entity.attackEntityFrom(DamageSource.func_35524_a(entity, entity), -4);
}
Note that it does make the noise like you get hurt but it heals you. You can change this by changing the function from DamageSource.
This goes in Blocknamehere
If you use this in mod can i get credit for fixing it?
breakyorself- Member
- Posts : 60
Join date : 2011-10-19
Re: [answered] Help with crashing
You still keeping the healing thing in the mod?
breakyorself- Member
- Posts : 60
Join date : 2011-10-19
Similar topics
» [Answered]Reobfuscate
» [answered] What do i do when the coding is done?
» [Answered] ore mining help
» [Answered]Ore Generation Error
» [Answered] tree
» [answered] What do i do when the coding is done?
» [Answered] ore mining help
» [Answered]Ore Generation Error
» [Answered] tree
MC Modding :: Help :: Help
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum