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.

ZacDoesStuff

Forge Modder
  • Joined

  • Last visited

  1. Hi, I've seen mods that have boots that turn water into ice on contact, and have been having trouble on finding out exactly how they did that. More specifically, I want to create skates... What is the code needed for detecting a block in armour?
  2. It's still not working: public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemStack) { ItemStack boots = player.getCurrentArmor(0); ItemStack legs = player.getCurrentArmor(1); ItemStack chest = player.getCurrentArmor(2); ItemStack helm = player.getCurrentArmor(3); // legs = 1, chest = 2, helm = 3 if (!world.isRemote){ if (boots != null && boots.getItem() == CanadianMod.skates && legs != null && legs.getItem() == CanadianMod.hockeyPants && chest != null && chest.getItem() == CanadianMod.hockeyChest && helm != null && helm.getItem() == CanadianMod.hockeyHelmet && world.getBlockId((int)player.posX, (int)player.posY-1, (int)player.posZ) == Block.ice.blockID){ player.motionX *= 1.1D; player.motionZ *= 1.1D; } } }
  3. The problem isn't in the motion.x, that works fine without looking for a block. The problem itself is looking for a block
  4. I've done that too
  5. Here you go, keep in mind I'm in 1.6.4 public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemStack) { super.onArmorTickUpdate(world, player, itemStack); ItemStack boots = player.getCurrentArmor(0); ItemStack legs = player.getCurrentArmor(1); ItemStack chest = player.getCurrentArmor(2); ItemStack helm = player.getCurrentArmor(3); // legs = 1, chest = 2, helm = 3 if (boots != null && boots.getItem() == CanadianMod.skates && legs != null && legs.getItem() == CanadianMod.hockeyPants && chest != null && chest.getItem() == CanadianMod.hockeyChest && helm != null && helm.getItem() == CanadianMod.hockeyHelmet && world.getBlockId((int)player.posX, (int)player.posY, (int)player.posZ) == Block.ice.blockID){ player.motionX *= 1.1D; player.motionZ *= 1.1D; }} The player.motionX and Z will change to probably a speed potion effect when on ice, since currently that has some weird effects when on ice
  6. Changed it, still doesn't work...
  7. Woops, forgot to change that. Put I already had tried that before asking on the forums When I was asked for the code I just quickly put it back in
  8. public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemStack) { super.onArmorTickUpdate(world, player, itemStack); ItemStack boots = player.getCurrentArmor(0); ItemStack legs = player.getCurrentArmor(1); ItemStack chest = player.getCurrentArmor(2); ItemStack helm = player.getCurrentArmor(3); // legs = 1, chest = 2, helm = 3 if (boots != null && boots.getItem() == CanadianMod.skates && legs != null && legs.getItem() == CanadianMod.hockeyPants && chest != null && chest.getItem() == CanadianMod.hockeyChest && helm != null && helm.getItem() == CanadianMod.hockeyHelmet && world.getBlockId((int)player.posX, (int)player.posX, (int)player.posX) == Block.ice.blockID){ player.motionX *= 1.1D; player.motionZ *= 1.1D; } }
  9. I tried that, it didn't do anything
  10. Alright, the method I have is public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemStack), but I want it to also check for a block that the player is on, so I'm using world.getBlockID(par2, par3, par4), but how do I correctly add the par2, par3, par4 into the method?
  11. It's saying .getEquimentInSlot does not exist
  12. Within my armour class, how would I test for the player wearing a full set of armour? I have this: public void onArmorTickUpdate(World world, EntityPlayer player, ItemStack itemStack) { int i = EntityLiving.getArmorPosition(itemStack) - 1; ItemStack itemstack1 = player.getCurrentArmor(i); if (itemstack1.itemID != CanadianMod.skates.itemID... But that seems to only be returning one time at a time. Suggestions would be great!
  13. 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...
  14. 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

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.