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'm trying to make boots that when worn as you are walking, it changes water to ice if you walk on the water.  Can someone help me with this?

I recommend checking out onArmorTickUpdate in the Item.class.  You can use it on your boots so that when they are equipped, you can check where the player is and see what block they might be standing on.

width=320 height=64http://www.slothygaming.com/img/ota.png[/img]

If your grammar is shit and you blatantly don't know what you're doing, I will not help you.

  • Author

I've been using the onArmorTick method, however I'm having trouble finding out how to find and replace the right block.  So far I've got this.

 

 

@Override

public void onArmorTick(World world, EntityPlayer player, ItemStack armor) {

int x = (int) player.posX;

int y = (int) (player.posY - 0.5D);

int z = (int) player.posZ;

Block block = world.getBlock(x, y, z);

        if(armor.getItem() == ElementalArmor.iceBoots){

if(block == Blocks.water){

world.setBlock(x, y, z, Blocks.ice);

}

        }

}

 

 

  • Author

That worked about the same.  I should probably specify.  It will replace the water block to the east but not to any other direction.

Maybe you can search several blocks around the player and changes the water block(s) to the ice.

 

like:

for(int i = -1; i <= 1; i++)

for(int j = -1; j <= 1; j++)

for(int k = -2; k <= -1; k++){

if(world.getBlock(posX-i, posY-k, posZ-j) is waterblock)

change the block to ice block.

}

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

@Override

public void onArmorTick(World world, EntityPlayer player, ItemStack armor) {
   int x = (int) player.posX;
   int y = (int) (player.posY - 0.5D);
   int z = (int) player.posZ;

   if(armor.getItem() != ElementalArmor.iceBoots) return;

   for(int i = -1; i <= 1; i++)
     for(int j = -1; j <= 1; j++)
       for(int k = -2; k <= -1; k++){
           if(world.getBlock(x-i, y-k, z-j) == Blocks.water)
                world.setBlock(x-i, y-k, z-j, Blocks.ice);
      }
        
}

 

Did you try this?

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

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.