Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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  :)

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.

  • 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...

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.

  • Author

Easiest way would probably be by multiplying the player's current velocity until they hit a max.

 

And how would I do that? :/

 

 

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.