MC Modding
Please register and join the community!


Join the forum, it's quick and easy

MC Modding
Please register and join the community!
MC Modding
Would you like to react to this message? Create an account in a few clicks or log in to continue.

[Answered] tree

3 posters

MC Modding :: Help :: Help

Go down

[Answered] tree Empty [Answered] tree

Post by AthosZBrogi Mon Oct 31, 2011 6:37 am

how do you make a tree only spawn on a certain block, like grass or dirt, or only be able to place that tree block on certain blocks like a cuctus(cactus can only spawn and be placed on sand)


Last edited by AthosZBrogi on Tue Nov 01, 2011 12:46 am; edited 1 time in total

AthosZBrogi
Member

Posts : 12
Join date : 2011-10-24
Age : 27

Back to top Go down

[Answered] tree Empty Re: [Answered] tree

Post by ikke009 Mon Oct 31, 2011 10:46 am

try this, i have no idea if it works tho i got it from the BlockCactus.java
Code:

public boolean canBlockStay(World world, int i, int j, int k)
{
    if(world.getBlockMaterial(i - 1, j, k).isSolid())
    {
        int l = world.getBlockId(i, j - 1, k);
        return l == Block.grass.blockID || l == Block.dirt.blockID;
    }
    return true;
}
ikke009
ikke009
Member

Posts : 65
Join date : 2011-10-24
Age : 30
Location : The netherlands

Back to top Go down

[Answered] tree Empty Re: [Answered] tree

Post by lcass Mon Oct 31, 2011 6:10 pm

well you could use the code in trees already

lcass
Member

Posts : 145
Join date : 2011-10-24
Location : england

https://www.youtube.com/user/thealcasgroup

Back to top Go down

[Answered] tree Empty Re: [Answered] tree

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

MC Modding :: Help :: Help

 
Permissions in this forum:
You cannot reply to topics in this forum