[Answered] tree
3 posters
MC Modding :: Help :: Help
Page 1 of 1
[Answered] tree
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
Re: [Answered] tree
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- Member
- Posts : 65
Join date : 2011-10-24
Age : 30
Location : The netherlands
Similar topics
» [Answered]Reobfuscate
» [answered] What do i do when the coding is done?
» [answered] Help with crashing
» [Answered] ore mining help
» [Answered] Tut on smelting
» [answered] What do i do when the coding is done?
» [answered] Help with crashing
» [Answered] ore mining help
» [Answered] Tut on smelting
MC Modding :: Help :: Help
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum