How to Generate items in chests
5 posters
MC Modding :: Modding :: Singleplayer Modding :: Requests
Page 1 of 1
How to Generate items in chests
i would like to know how to get items to generate in a chest if you wouldnt mine makeing a tutorial or some1 explaining to me how this can be done
Admin Edit: Wrong section. Moved to Singleplayer Requests.
Admin Edit: Wrong section. Moved to Singleplayer Requests.
TheWerty1124- Member
- Posts : 3
Join date : 2011-10-20
Re: How to Generate items in chests
I could use this tutorial also. It will help me with a banking mod that I am making.
Static_boy123- Helper
- Posts : 32
Join date : 2011-10-19
Age : 25
Location : Eclipse Indigo
Re: How to Generate items in chests
yeai need it for a mod im makeing also
TheWerty1124- Member
- Posts : 3
Join date : 2011-10-20
Re: How to Generate items in chests
This is how notch gets random items into dungeon chests:
- Code:
private ItemStack pickCheckLootItem(Random random)
{
int i = random.nextInt(11);
if(i == 0)
{
return new ItemStack(Item.saddle);
}
if(i == 1)
{
return new ItemStack(Item.ingotIron, random.nextInt(4) + 1);
}
if(i == 2)
{
return new ItemStack(Item.bread);
}
if(i == 3)
{
return new ItemStack(Item.wheat, random.nextInt(4) + 1);
}
if(i == 4)
{
return new ItemStack(Item.gunpowder, random.nextInt(4) + 1);
}
if(i == 5)
{
return new ItemStack(Item.silk, random.nextInt(4) + 1);
}
if(i == 6)
{
return new ItemStack(Item.bucketEmpty);
}
if(i == 7 && random.nextInt(100) == 0)
{
return new ItemStack(Item.appleGold);
}
if(i == 8 && random.nextInt(2) == 0)
{
return new ItemStack(Item.redstone, random.nextInt(4) + 1);
}
if(i == 9 && random.nextInt(10) == 0)
{
return new ItemStack(Item.itemsList[Item.record13.shiftedIndex + random.nextInt(2)]);
}
if(i == 10)
{
return new ItemStack(Item.dyePowder, 1, 3);
} else
{
return null;
}
}
breakyorself- Member
- Posts : 60
Join date : 2011-10-19
Re: How to Generate items in chests
i have that part done its just the items generating in it
TheWerty1124- Member
- Posts : 3
Join date : 2011-10-20
Re: How to Generate items in chests
look through the code classes and find the dungeon one that generates the dungeon and look through it.
breakyorself- Member
- Posts : 60
Join date : 2011-10-19
Re: How to Generate items in chests
well breakyourself set it as a void then declare when its being made
Re: How to Generate items in chests
I`m not trying to make it i`m just giving them a suggestion on how they might find out how to do it.
breakyorself- Member
- Posts : 60
Join date : 2011-10-19
Re: How to Generate items in chests
Well you said "Well breakyorself"
breakyorself- Member
- Posts : 60
Join date : 2011-10-19
Re: How to Generate items in chests
maybe you should use ShockahAPI
maciejkiller- Member
- Posts : 5
Join date : 2011-11-07
MC Modding :: Modding :: Singleplayer Modding :: Requests
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum