Posted April 18, 201411 yr Hi! I've created an armour for my mod where the boots are skates. My plan is to have the skates allow you to walk on ice like it's a normal block, or even "skate" on it faster, but I have no idea where to start to tackle this. Any suggestions would be great! Thanks, ZacDoesStuff
April 19, 201411 yr Use World#getBlockId() if you are in 1.6.4. You can use the player's position, and check the block under the player. If it is ice block, you can make the player "skate" fast. you can refer to the player running code. I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP) II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.
April 19, 201411 yr Author Use World#getBlockId() if you are in 1.6.4. You can use the player's position, and check the block under the player. If it is ice block, you can make the player "skate" fast. you can refer to the player running code. Where would I do all this? In the armour class? I tried this public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemStack, int par2, int par3, int par4) { if (itemStack.itemID == CanadianMod.skates.itemID && (world.getBlockId(par2, par3-1, par4) == Block.ice.blockID)){ Block.ice.slipperiness = 0.00F; } } But that was before i knew where to start, I kind of just guessed...
April 19, 201411 yr No, don't do that! It sounds right when you're new, but it's like sounding out words when you learn to read. You have to go through your code line by line and figure out what each one does on its own. Let's try that: { if (itemStack.itemID == CanadianMod.skates.itemID && (world.getBlockId(par2, par3-1, par4) == Block.ice.blockID)){ Block.ice.slipperiness = 0.00F; } } If the item is a pair of skates and the block below the player is ice All ice in the world (In every dimension) now has 0 slipperiness forever. (Since you're not saving the current slipperiness and setting it back.) Changing the slipperiness of an individual block in a cube based game isn't reasonable: you want to cheat. Easiest way would probably be by multiplying the player's current velocity until they hit a max.
April 19, 201411 yr Author Easiest way would probably be by multiplying the player's current velocity until they hit a max. And how would I do that?
April 19, 201411 yr You could however get the block the player is standing on and ONLY affecting the block that the player is standing on - setting it back [to the original slipperiness] if the player is not on it.
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.