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

I have a block that is essentially vines. I was wondering how to make it so that they generate in the world on the sides of trees?

Legend of Zelda Mod[updated September 20th to 3.1.1]

Extra Achievements(Minecraft 1.8!)[updated April 3rd to 2.3.0]

Fancy Cheeses[updated May 8th to 0.5.0]

  • Author

I would just make a world generator for your vines, and right before the setBlock function add a test to make sure one of the blocks next to it is wood. Here's a descent tutorial on adding worldgen:

http://www.minecraftforge.net/wiki/Adding_World_Generation

How do i check for neighboring blocks? kind of a noob...

Legend of Zelda Mod[updated September 20th to 3.1.1]

Extra Achievements(Minecraft 1.8!)[updated April 3rd to 2.3.0]

Fancy Cheeses[updated May 8th to 0.5.0]

  • Author

~bump~?

Legend of Zelda Mod[updated September 20th to 3.1.1]

Extra Achievements(Minecraft 1.8!)[updated April 3rd to 2.3.0]

Fancy Cheeses[updated May 8th to 0.5.0]

Under generate, just do:

boolean shouldPlace = false;

if(world.getBlock(xCoord + 1, yCoord, zCoord) == Blocks.wood)/** Or whatever block **/{
shouldPlace = true;
}
}


if(world.getBlock(xCoord, yCoord, zCoord + 1) == Blocks.wood)/** Or whatever block **/{
shouldPlace = true;
}
}
if(world.getBlock(xCoord - 1, yCoord, zCoord) == Blocks.wood)/** Or whatever block **/{
shouldPlace = true;
}
}


if(world.getBlock(xCoord, yCoord, zCoord - 1) == Blocks.wood)/** Or whatever block **/{
shouldPlace = true;
}
if(shouldPlace){
world.setBlock(yourBlockName); //Or whatever function to generate the block
}

Keep in mind I just did this on the fly and you WILL have to modify it a bit, but you should be able to handle that...

Another thing, the thing you're trying to do will be inherently laggy because it will likely have to run this code for EVERY block (or some constraint of blocks, like every block between y = 50 and y = 90 or whatever). This would apply to almost any solution for this though. (Unless you want the vines to only generate on your custom trees, in which case you could just make the vines generate as part of the tree and it would make about 8039x more sense then this :P)

Creator of Metroid Cubed! Power Suits, Beams, Hypermode and more!

width=174 height=100http://i.imgur.com/ghgWmA3.jpg[/img]

More gratuitous cut&paste...

Will this nonsense ever end?

 

Nope.. :|.

---------

 

@chimera27,

 

I'm pretty sure if he puts in for example:

if(world.getBlock(xCoord - 1, yCoord, zCoord) == Blocks.leaves)

 

It will render this vines nearly on every tree.

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.