Jump to content

beingben

Members
  • Posts

    14
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

beingben's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I do see that, the problem is why doesn't it see it. I have the file the Class it claims it cannot find within my Project as a source folder. Here is a picture of my setup if that could help in anyway. (link encase you cannot see the image like myself)
  2. I have, sadly after three days all I could get was a moderator to delete my triple post. --Edit-- With some expierimenting i was able to get it to compile. Launches and I'm able to interact with the world. Once I interact with grass it crashes. Can anyone tell me what is causing this within my code?
  3. Below is quoted reply from the TFC-Forum, I followed these directions.
  4. I've corrected the code and manage to get it working. Now the problem seems to be it won't compile...I first posted the question on the mod-Owners website but they do not reply. After running gradlew build the following error occurs: BUILD FAILED Total time: 5.82 secs C:\Users\beingben\Desktop\Forge Folder>gradlew build **************************** Powered By MCP: http://mcp.ocean-labs.de/ Searge, ProfMobius, Fesh0r, R4wk, ZeuX, IngisKahn, bspkrs MCP Data version : unknown **************************** :compileApiJava UP-TO-DATE :processApiResources UP-TO-DATE :apiClasses UP-TO-DATE :sourceMainJava UP-TO-DATE :compileJava warning: [options] bootstrap class path not set in conjunction with -source 1.6 C:\Users\beingben\Desktop\Forge Folder\build\sources\java\com\beingben\tfcraftad don\TFCGrassDropsEvent.java:5: error: package com.bioxx.tfc.api does not exist import com.bioxx.tfc.api.TFCBlocks; ^ C:\Users\beingben\Desktop\Forge Folder\build\sources\java\com\beingben\tfcraftad don\TFCGrassDropsEvent.java:20: error: cannot find symbol if (event.block == TFCBlocks.TallGrass) { ^ symbol: variable TFCBlocks location: class TFCGrassDropsEvent 2 errors 1 warning :compileJava FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':compileJava'. > Compilation failed; see the compiler error output for details. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 8.687 secs C:\Users\beingben\Desktop\Forge Folder> The referenced file and import does exist...otherwise I wouldn't see it and I wouldn't be able to launch the game within eclipse and test the code with success.
  5. When should or would it be null??
  6. Alright, so after so much needed reading and trial an error of reading other source file mod addons I finally see some progress. I can launch the game, I can break a grass block and it successfully says "Test" in chat. Sadly, after I break a TallGrass the game crashes. Below is my simplified code and my crash report. Any and All help is welcome. MainPackage: package com.beingben.tfcraft.addon; import net.minecraft.init.Blocks; import net.minecraftforge.common.MinecraftForge; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.registry.GameRegistry; @Mod(modid = TFCraftaddon.MODID, version = TFCraftaddon.VERSION) public class TFCraftaddon{ public static final String MODID = "TFCraftAddon"; public static final String VERSION = "1.0"; TFCGrassDropsEvent events = new TFCGrassDropsEvent(); @EventHandler public void init(FMLInitializationEvent event) { FMLCommonHandler.instance().bus().register(events); MinecraftForge.EVENT_BUS.register(events); } } GrassEvent: package com.beingben.tfcraft.addon; import net.minecraft.util.ChatComponentText; import net.minecraftforge.event.world.BlockEvent.HarvestDropsEvent; import com.bioxx.tfc.api.TFCBlocks; import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class TFCGrassDropsEvent { @SubscribeEvent public void blockHarvestEvent(HarvestDropsEvent event) { if (event.block == TFCBlocks.TallGrass) { event.harvester.addChatMessage(new ChatComponentText("Test")); } } } Crash Log: ---- Minecraft Crash Report ---- // Why did you do that? Time: 2/15/15 12:22 AM Description: Exception while updating neighbours java.lang.NullPointerException: Exception while updating neighbours at com.beingben.tfcraft.addon.TFCGrassDropsEvent.blockHarvestEvent(TFCGrassDropsEvent.java:14) at cpw.mods.fml.common.eventhandler.ASMEventHandler_21_TFCGrassDropsEvent_blockHarvestEvent_HarvestDropsEvent.invoke(.dynamic) at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54) at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:138) at net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(ForgeEventFactory.java:155) at net.minecraft.block.Block.dropBlockAsItemWithChance(Block.java:806) at net.minecraft.block.Block.dropBlockAsItem(Block.java:795) at net.minecraft.block.BlockBush.checkAndDropBlock(BlockBush.java:74) at net.minecraft.block.BlockBush.onNeighborBlockChange(BlockBush.java:56) at net.minecraft.world.World.notifyBlockOfNeighborChange(World.java:787) at net.minecraft.world.World.notifyBlocksOfNeighborChange(World.java:738) at net.minecraft.world.World.notifyBlockChange(World.java:697) at net.minecraft.world.World.markAndNotifyBlock(World.java:556) at net.minecraft.world.World.setBlock(World.java:534) at net.minecraft.world.World.setBlockToAir(World.java:651) at com.bioxx.tfc.Blocks.Terrain.BlockDirt.updateTick(BlockDirt.java:228) at net.minecraft.world.WorldServer.func_147456_g(WorldServer.java:408) at net.minecraft.world.WorldServer.tick(WorldServer.java:191) at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:692) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at com.beingben.tfcraft.addon.TFCGrassDropsEvent.blockHarvestEvent(TFCGrassDropsEvent.java:14) at cpw.mods.fml.common.eventhandler.ASMEventHandler_21_TFCGrassDropsEvent_blockHarvestEvent_HarvestDropsEvent.invoke(.dynamic) at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54) at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:138) at net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(ForgeEventFactory.java:155) at net.minecraft.block.Block.dropBlockAsItemWithChance(Block.java:806) at net.minecraft.block.Block.dropBlockAsItem(Block.java:795) at net.minecraft.block.BlockBush.checkAndDropBlock(BlockBush.java:74) at net.minecraft.block.BlockBush.onNeighborBlockChange(BlockBush.java:56) -- Block being updated -- Details: Source block type: ID #190 (tile.dirt // com.bioxx.tfc.Blocks.Terrain.BlockDirt) Block type: ID #204 (tile.TallGrass // com.bioxx.tfc.Blocks.Vanilla.BlockCustomTallGrass) Block data value: 0 / 0x0 / 0b0000 Block location: World: (-157,146,-6395), Chunk: (at 3,9,5 in -10,-400; contains blocks -160,0,-6400 to -145,255,-6385), Region: (-1,-13; contains chunks -32,-416 to -1,-385, blocks -512,0,-6656 to -1,255,-6145) Stacktrace: at net.minecraft.world.World.notifyBlockOfNeighborChange(World.java:787) at net.minecraft.world.World.notifyBlocksOfNeighborChange(World.java:738) at net.minecraft.world.World.notifyBlockChange(World.java:697) at net.minecraft.world.World.markAndNotifyBlock(World.java:556) at net.minecraft.world.World.setBlock(World.java:534) at net.minecraft.world.World.setBlockToAir(World.java:651) at com.bioxx.tfc.Blocks.Terrain.BlockDirt.updateTick(BlockDirt.java:228) at net.minecraft.world.WorldServer.func_147456_g(WorldServer.java:408) at net.minecraft.world.WorldServer.tick(WorldServer.java:191) -- Affected level -- Details: Level name: grassTest All players: 1 total; [EntityPlayerMP['Player106'/202, l='grassTest', x=-82.63, y=148.00, z=-6366.98]] Chunk stats: ServerChunkCache: 698 Drop: 0 Level seed: -5379282275939727980 Level generator: ID 00 - TFCDefault, ver 0. Features enabled: true Level generator options: Level spawn location: World: (-64,147,-6364), Chunk: (at 0,9,4 in -4,-398; contains blocks -64,0,-6368 to -49,255,-6353), Region: (-1,-13; contains chunks -32,-416 to -1,-385, blocks -512,0,-6656 to -1,255,-6145) Level time: 576992 game time, 576992 day time Level dimension: 0 Level storage version: 0x04ABD - Anvil Level weather: Rain time: 76936 (now: false), thunder time: 118390 (now: false) Level game mode: Game mode: survival (ID 0). Hardcore: false. Cheats: false Stacktrace: at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:692) at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) -- System Details -- Details: Minecraft Version: 1.7.10 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.7.0_75, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 638044792 bytes (608 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.05 FML v7.10.85.1272 Minecraft Forge 10.13.2.1272 6 mods loaded, 6 mods active mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available FML{7.10.85.1272} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.2.1272.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Forge{10.13.2.1272} [Minecraft Forge] (forgeSrc-1.7.10-10.13.2.1272.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available tfc_coremod{0.79.15} [TFC[coremod]] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available TFCraftAddon{1.0} [TFCraftAddon] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available terrafirmacraft{0.79.15} [TerraFirmaCraft] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available Profiler Position: N/A (disabled) Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Player Count: 1 / 8; [EntityPlayerMP['Player106'/202, l='grassTest', x=-82.63, y=148.00, z=-6366.98]] Type: Integrated Server (map_client.txt) Is Modded: Definitely; Client brand changed to 'fml,forge'
  7. Okay, I'm clearly very new to moding and have much to learn. I will look to find some references or tutorials on the GameRegistry. Thanks diesieben
  8. I did not create a new block, I just attempted to create an event at which a prexisting block is harvested. Problem for me is calling the prexisting block to be listened for on blockHarvestEvents.
  9. Figured I'd make a post since I'm not getting much further on my own. Below I will post both the TFC_Custom grass java and my GrassBreak Java. I'm currently unable to specify the block on which to call the event under line 35. Any help, much appreciated. My Java package com.beingben.tfcraft.addon; import java.util.Random; import com.bioxx.tfc.Blocks.Vanilla.*; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.ChatComponentText; import net.minecraft.util.IChatComponent; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.event.world.BlockEvent.HarvestDropsEvent; public class GrassBreak { Random random; @SubscribeEvent public void onHarvestDrops(BlockEvent.HarvestDropsEvent event) { random = new Random(); Block block = event.block; EntityPlayer player = event.harvester; if(player!=null) { [color=red]if (block == BlockCustomTallGrass) {[/color] event.harvester.addChatMessage(new ChatComponentText("Test")); Random rnd = new Random(); int chance = rnd.nextInt(100); // can be float, but int should // testing simple vanilla drops if (chance < 10) { event.drops.add(new ItemStack(Items.clay_ball)); // 10 % } else if (chance < 25) { event.drops.add(new ItemStack(Items.painting));// 15 % } else if (chance < 50) { event.drops.add(new ItemStack(Items.bucket));// 25 % } else if (chance < 75) { event.drops.add(new ItemStack(Items.bone)); // 25 % } else { event.drops.add(new ItemStack(Items.string));// 25 % } } } } } TFC_Custom_Grass package com.bioxx.tfc.Blocks.Vanilla; import java.util.ArrayList; import java.util.List; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.BlockTallGrass; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.IShearable; import com.bioxx.tfc.Reference; import com.bioxx.tfc.TerraFirmaCraft; import com.bioxx.tfc.Core.ColorizerFoliageTFC; import com.bioxx.tfc.Core.ColorizerGrassTFC; import com.bioxx.tfc.Core.Recipes; import com.bioxx.tfc.Core.TFCTabs; import com.bioxx.tfc.Core.TFC_Climate; import com.bioxx.tfc.Core.TFC_Core; import com.bioxx.tfc.Core.TFC_Sounds; import com.bioxx.tfc.api.TFCItems; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class BlockCustomTallGrass extends BlockTallGrass implements IShearable { private static final String[] MetaNames = new String[] {"tallgrass", "fern", "shortgrass"}; @SideOnly(Side.CLIENT) private IIcon[] icons; public BlockCustomTallGrass() { super(); float var3 = 0.4F; this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, 0.8F, 0.5F + var3); this.setCreativeTab(TFCTabs.TFCDecoration); } @Override public void getSubBlocks(Item item, CreativeTabs tab, List list) { for (int i = 0; i < MetaNames.length; ++i) { list.add(new ItemStack(item, 1, i)); } } @Override public int getBlockColor() { double var1 = 0.5D; double var3 = 1.0D; return ColorizerGrassTFC.getGrassColor(var1, var3); } @Override public int getRenderColor(int par1) { return par1 == 0 ? 16777215 : ColorizerFoliageTFC.getFoliageColorBasic(); } @Override public int colorMultiplier(IBlockAccess bAccess, int x, int y, int z) { return TerraFirmaCraft.proxy.grassColorMultiplier(bAccess, x, y, z); } @Override public Item getItemDropped(int metadata, Random rand, int fortune) { return null; } @Override public int quantityDroppedWithBonus(int i, Random rand) { return 1 + rand.nextInt(i * 2 + 1); } @Override public void harvestBlock(World world, EntityPlayer player, int i, int j, int k, int l) { super.harvestBlock(world, player, i, j, k, l); ItemStack is = player.inventory.getCurrentItem(); for(int c = 0; c < Recipes.Knives.length && is != null; c++) { if(is.getItem() == Recipes.Knives[c]) { createStraw(world, player, i, j, k); is.damageItem(1, player); break; } } for(int c = 0; c < Recipes.Scythes.length && is != null; c++) { if(is.getItem() == Recipes.Scythes[c]) { //Spawn the straw for the block that we've already destroyed createStraw(world, player, i, j, k ); //Now check each block around the destroyed block for AOE directions for(int x = -1; x < 2; x++) { for(int z = -1; z < 2; z++) { if(world.getBlock(i + x, j, k + z) == this) { createStraw(world, player, i + x, j, k + z); is.damageItem(1, player); world.setBlockToAir(i + x, j, k + z); } } } break; } } } private void createStraw(World world, EntityPlayer player, int i, int j, int k) { EntityItem ei = new EntityItem(world, i+0.5F, j+0.5F, k+0.5F, new ItemStack(TFCItems.Straw, 1)); world.spawnEntityInWorld(ei); } @Override public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int meta, int fortune) { ArrayList<ItemStack> ret = new ArrayList<ItemStack>(); //if (world.rand.nextInt( != 0) return ret; ItemStack item = GetSeeds(world.rand); if (item != null) ret.add(item); return ret; } @Override public boolean isShearable(ItemStack item, IBlockAccess world, int x, int y, int z) { return true; } @Override public ArrayList<ItemStack> onSheared(ItemStack item, IBlockAccess world, int x, int y, int z, int fortune) { ArrayList<ItemStack> ret = new ArrayList<ItemStack>(); ret.add(new ItemStack(this, 1, world.getBlockMetadata(x, y, z))); return ret; } protected boolean canThisPlantGrowOnThisBlock(Block block) { return TFC_Core.isSoil(block); // || par1 == Block.tilledField.blockID; } /** * Can this block stay at this position. Similar to canPlaceBlockAt except gets checked often with plants. */ @Override public boolean canBlockStay(World world, int x, int y, int z) { return (world.getFullBlockLightValue(x, y, z) >= 8 || world.canBlockSeeTheSky(x, y, z)) && this.canThisPlantGrowOnThisBlock(world.getBlock(x, y - 1, z)); } public static ItemStack GetSeeds(Random R) { ItemStack is = null; /*if(R.nextInt(100) == 0) { int r = R.nextInt(19); switch(r) { case 0: is = new ItemStack(TFCItems.SeedsWheat,1); break; case 1: is = new ItemStack(TFCItems.SeedsMaize,1); break; case 2: is = new ItemStack(TFCItems.SeedsTomato,1); break; case 3: is = new ItemStack(TFCItems.SeedsBarley,1); break; case 4: is = new ItemStack(TFCItems.SeedsRye,1); break; case 5: is = new ItemStack(TFCItems.SeedsOat,1); break; case 6: is = new ItemStack(TFCItems.SeedsRice,1); break; case 7: is = new ItemStack(TFCItems.SeedsPotato,1); break; case 8: is = new ItemStack(TFCItems.SeedsOnion,1); break; case 9: is = new ItemStack(TFCItems.SeedsCabbage,1); break; case 10: is = new ItemStack(TFCItems.SeedsGarlic,1); break; case 11: is = new ItemStack(TFCItems.SeedsCarrot,1); break; case 12: is = new ItemStack(TFCItems.SeedsYellowBellPepper,1); break; case 13: is = new ItemStack(TFCItems.SeedsRedBellPepper,1); break; case 14: is = new ItemStack(TFCItems.SeedsSoybean,1); break; case 15: is = new ItemStack(TFCItems.SeedsGreenbean,1); break; case 16: is = new ItemStack(TFCItems.SeedsSquash,1); break; } }*/ return is; } @SideOnly(Side.CLIENT) @Override public void registerBlockIcons(IIconRegister register) { this.icons = new IIcon[MetaNames.length]; for (int i = 0; i < this.icons.length; ++i) { this.icons[i] = register.registerIcon((i > 1 ? Reference.ModID + ":plants/" : "") + MetaNames[i]); } } @SideOnly(Side.CLIENT) @Override public IIcon getIcon(int side, int meta) { if (meta >= this.icons.length) meta = 0; return this.icons[meta]; } @Override public void updateTick(World w, int x, int y, int z, Random rand) { // Play cricket sound at night float temp = TFC_Climate.getHeightAdjustedTemp(w, x, y, z); /*Crickets typically don't mate below 55F and are nocturnal. We're being oddly accurate about this lol -B*/ if(!w.isRemote && w.getBlockLightValue(x, y, z) < 7 && temp > 12.77) { if(w.rand.nextInt(Math.max(((int)((160)/(temp-4))),1)) < 2) //chirp intensity grows with higher temperature { float vol = 0.1f + (w.rand.nextFloat() * 0.20F); // keep the volume between 0 and 0.3 float pitch = ((temp / 100) * 2) + 0.5F + vol; // the chirp frequency will change depending on the climate temperature w.playSoundEffect(x, y, z, TFC_Sounds.CRICKET, vol, pitch); } if(rand.nextInt(==0){ w.scheduleBlockUpdate(x, y, z, this, 5); } } super.updateTick(w, x, y, z, rand); } }
  10. I'm not trying to make a new grass. What I am attempting is to add an item or items that is dropped by a new grass added in the TerraFirmaCraft mod. I'm just trying to find some direction on what to use in forge in allowing this.
  11. That would be the class that controls the generation and growth of TallGrass. I'm attempting a small mod to add further use of this TallGrass.
  12. Alright, so MinecraftForge.addGrassSeed, Is there a way to have a BlockEvent ? To allow me a random drop of different items as i tried with the previously informed event hook. Here was my attempt from your earlier reply. package com.beingben.tfcraft.addon; import java.util.Random; import com.bioxx.tfc.TFCBlocks; import com.bioxx.tfc.Blocks.Terrain.BlockGrass; import com.bioxx.tfc.Core.TFCTabs; import vazkii.botania.common.item.*; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.event.world.BlockEvent; public class grassBreak extends BlockGrass { @SubscribeEvent public void onBlockDropItems(BlockEvent.HarvestDropsEvent event){ if (event.block == TFCBlocks.TallGrass){ Random rnd =new Random(); if (rnd.nextFloat() <= 0.10f) event.drops.add(new ItemStack(Items.bone)); if (rnd.nextFloat() > 0.10f && rnd.nextFloat() <= .025f); event.drops.add(new ItemStack(Items.wheat_seeds)); if (rnd.nextFloat() > 0.10f && rnd.nextFloat() <= .050f); event.drops.add(new ItemStack(Items.apple)); if (rnd.nextFloat() > 0.10f && rnd.nextFloat() <= .075f); event.drops.add(new ItemStack(Items.stick)); } } }
  13. I'm beginning my career in Computer Science and adventuring into Java with some simple minecraft modding. I'd like to be able to create just a simple mod for now allowing my to add an item to be dropped when breaking grass. Once i can figure this simple code out I'd like to expand it into an entire mod for editing what any item or block can drop when broken. So any help at this early stage is much appreciated. This is just a test for dropping 4 items from a random chance when breaking a grass block. package com.beingben.tfcraft.addon; import java.util.Random; import com.bioxx.tfc.Blocks.Terrain.BlockGrass; import com.bioxx.tfc.Core.TFCTabs; import vazkii.botania.common.item.*; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Items; import net.minecraft.item.Item; public class grassBreak extends BlockGrass { public Item idDropped(int par1, Random par2Random, int par3) { double r = Math.random(); if (r < 0.25){ Item ItemFertilizer; return ItemFertilizer; }else if (r < 0.5){ return Items.wheat_seeds; }else if (r < 0.75){ } return Items.bone; }else{ return Items.clay_ball; } } }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.