Posted November 23, 201212 yr Hello modders! I'm kinda a noob on modding Minecraft, and I'm working on a mod that haves a block that allows you to jump high when you jump on them, but I've searched everywhere and I can't find the code that I need. Can you please help me? Thank you!
November 24, 201212 yr Hi I made it like this: public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4){ return null; } The Player can collide with it. The player is pushed up into the air. public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { par5Entity.fallDistance = 0; if(par5Entity instanceof EntityPlayer && ((EntityPlayer)par5Entity).isJumping) //Check if the Entity is a player and is jumping { par5Entity.motionY += 1; //High jump } }
November 24, 201212 yr Author Hi I made it like this: public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4){ return null; } The Player can collide with it. The player is pushed up into the air. public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity) { par5Entity.fallDistance = 0; if(par5Entity instanceof EntityPlayer && ((EntityPlayer)par5Entity).isJumping) //Check if the Entity is a player and is jumping { par5Entity.motionY += 1; //High jump } } It works! Thank you! <3
January 29, 201312 yr Sorry if this is late reply, but I'm looking into a similar block function. The given code here doesn't quite do what I want. I don't want the player pushed into the air when they collide with the block. I want them to interact with the block normally, but if the player jumps, I want to be able to double (or more) their jump height. Anyone know of a way to do this? I've looked at examples of "jump boots" and the like, but they're not quite working.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.