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.

SuperHB

Forge Modder
  • Joined

  • Last visited

Everything posted by SuperHB

  1. I tried the code and it gave me an error saying you have to put stuff in the () and it auto added it for me and it still doesn't work. And yes I am from PMC. JustKilling is my username on it Here is the code: //PreInitialize public void preInit(FMLPreInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new LivingDropsEvent(null, null, null, 0, false, 0)); proxy.initCapes(); } That's what it add for it to not have an error
  2. How do i do that? I never had to do that before And here is the code I'm using now and it still doesn't work package net.net46.thesuperhb.MobDrops; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraft.entity.passive.*; import net.minecraft.entity.monster.*; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraftforge.event.entity.living.LivingDeathEvent; import net.minecraftforge.event.entity.living.LivingDropsEvent; import net.minecraftforge.event.entity.living.LivingSpawnEvent; public class LivingDropEvent { public static double rand; @SubscribeEvent public void onDrop(LivingDropsEvent event) { // you can also check the random chance here, rather than every time, // since you use the exact same probability for all your cases if (event.source.getDamageType().equals("player") && event.entity.worldObj.rand.nextFloat() < 1.00F) { if (event.entity instanceof EntityCow) { event.entityLiving.dropItem(Items.bone, 12); event.entityLiving.dropItem(MobDrops.cowHorn, 2); event.entityLiving.dropItem(MobDrops.ribCage, 1); } else if (event.entity instanceof EntityMooshroom) { event.entityLiving.dropItem(Items.bone, 12); event.entityLiving.dropItem(MobDrops.cowHorn, 2); event.entityLiving.dropItem(MobDrops.ribCage, 1); event.entityLiving.dropItem(MobDrops.redLeather, 3); } } } } I commented out the rest of the code so I could just try it out with the Cow and Mooshroom. Still doesn't work
  3. This is the code I used for my Block package net.net46.thesuperhb.MobDrops.Block; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.net46.thesuperhb.MobDrops.MobDrops; public class BlockGrill extends Block { public BlockGrill(Material p_i45394_1_) { super(p_i45394_1_); setCreativeTab(MobDrops.mobDrops); setHardness(5F); setResistance(4.0F); setBlockName("GrillBlock"); setBlockTextureName(MobDrops.MODID + ":beta"); //Texture :BlockGrill } }
  4. Yeah,it gave me errors because there wasn't a "this." and because it was .setTextureName inestead of .setBlocTextureName don't put a period before it
  5. I'm getting an error at if (event.source.getDamageType().equals("player") && event.entity.getWorldObj().rand.nextFloat() < 0.1F) { where it is at event.entity.getWorldObj I added one. Doesn't do much ._. @SubscribeEvent public void onEntityDropCow(LivingDropsEvent event) { if (event.source.getDamageType().equals("player")) { rand = Math.random(); if (event.entityLiving instanceof EntityCow) { //The 0.25d bit is the drop rate. at 0.25 it has a 25% chance of dropping. 1.00d is 100% if (rand < 0.17d) { event.entityLiving.dropItem(Items.bone, 12); event.entityLiving.dropItem(MobDrops.cowHorn, 2); event.entityLiving.dropItem(MobDrops.ribCage, 1); } } } }
  6. I only use the same probability for passive and different probability for aggressive mobs is there a way to set it for different mob groups?
  7. Try this: Put Texture Code in the BlockPlatOre and it should look like this EXACT: package k3.moreMetals; import net.minecraft.block.Block; import net.minecraft.block.material.Material; public class BlockPlatOre extends Block { public BlockPlatOre() { super(Material.iron); setTextureName(moreMetalsMod.MODID + ":orePlatinum"); } } It should work that's what I used for my code
  8. Hi was wondering if any knows how to add custom drops to vanilla mobs. This was the code that I used in 1.6 but i doesn't work anymore. http://pastebin.com/Y61EDXJD Please help, Thanks SuperHB
  9. Okay so I'm working on a mod and I'm using an OBJ model and I can't figure out how to set the block bounds for more than 1 block. I tried using the set block bound code but it doesn't work out when I try to make it out of 1 block. Here is my code that I'm using for my block. http://pastebin.com/DK5xqGX4 I've searched online and they said to check the BedBlock code and I see this thing with footBlockToHeadBlockMap and other stuff. Please Help Thanks, SuperHB
  10. Okay, so forge-1.7.2-10.12.0.1024-src was Recommended for awhile and I was setting it up for my mode and when I set it up it still gets errors. Does this happen for anyone else or just me? I also tried importing code from my mod to 1.7.2 and I get errors... I thought this was fixed alreay! If this is an issue that only a few people are getting please help! But if they are still working on then please let me know! Thanks, SuperHB
  11. Okay, so I tried pretty much EVERY... SINGLE... code in the AxisAlignedBB class and it still doesn't work... Here is all the code I used for it: /** * Sets the Collision of the Tardis so you can't walk through it. */ @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) { switch (world.getBlockMetadata(x, y, z)) { case 0: return AxisAlignedBB.getAABBPool().getAABB(x + minX, y + minY, z + minZ, x + maxX, y + maxY, z + maxZ); case 2: return AxisAlignedBB.getAABBPool().getAABB(x + minX, y + minY, z + minZ, x + maxX, y + maxY, z + maxZ); default: return AxisAlignedBB.getAABBPool().getAABB(x + 36.0D, y + 48.0D, z + 36.0D, x + 36.0D, y + 48.0D, z + 36.0D); } } @Override @SideOnly(Side.CLIENT) public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) { switch (world.getBlockMetadata(x, y, z)) { case 0: return AxisAlignedBB.getAABBPool().getAABB(x + minX, y + minY, z + minZ, x + maxX, y + maxY, z + maxZ); case 2: return AxisAlignedBB.getAABBPool().getAABB(x + minX, y + minY, z + minZ, x + maxX, y + maxY, z + maxZ); default: return AxisAlignedBB.getAABBPool().getAABB(x + 36.0D, y + 48.0D, z + 36.0D, x + 36.0D, y + 48.0D, z + 36.0D); } } public AxisAlignedBB getOffsetBoundingBox(World world, double par1, double par3, double par5, int x, int y, int z) { switch (world.getBlockMetadata(x, y, z)) { case 0: return AxisAlignedBB.getAABBPool().getAABB(minX + par1, minY + par3, minZ + par5, maxX + par1, maxY + par3, maxZ + par5); case 2: return AxisAlignedBB.getAABBPool().getAABB(minX + par1, minY + par3, minZ + par5, maxX + par1, maxY + par3, maxZ + par5); default: return AxisAlignedBB.getAABBPool().getAABB(par1 + 36.0D, par3 + 48.0D, par5 + 36.0D, par1 + 36.0D, par3 + 48.0D, par5 + 36.0D); } } public AxisAlignedBB setBounds(World world, double par1, double par3, double par5, double par7, double par9, double par11, int x, int y, int z) { switch (world.getBlockMetadata(x, y, z)) { case 0: return AxisAlignedBB.getAABBPool().getAABB(minX + par1, minY + par3, minZ + par5, maxX + par7, maxY + par9, maxZ + par11); case 2: return AxisAlignedBB.getAABBPool().getAABB(minX + par1, minY + par3, minZ + par5, maxX + par7, maxY + par9, maxZ + par11); default: return AxisAlignedBB.getAABBPool().getAABB(par1 + 36.0D, par3 + 48.0D, par5 + 36.0D, par7 + 36.0D, par9 + 48.0D, par11 + 36.0D); } } public AxisAlignedBB expand(World world, double par1, double par3, double par5, double par7, double par9, double par11, int x, int y, int z) { double d3 = this.minX - par1; double d4 = this.minY - par3; double d5 = this.minZ - par5; double d6 = this.maxX + par1; double d7 = this.maxY + par3; double d8 = this.maxZ + par5; switch (world.getBlockMetadata(x, y, z)) { case 0: return AxisAlignedBB.getAABBPool().getAABB(minX + par1, minY + par3, minZ + par5, maxX + par7, maxY + par9, maxZ + par11); case 2: return AxisAlignedBB.getAABBPool().getAABB(minX + par1, minY + par3, minZ + par5, maxX + par7, maxY + par9, maxZ + par11); case 4: return AxisAlignedBB.getAABBPool().getAABB(d3, d4, d5, d6, d7, d8); default: return AxisAlignedBB.getAABBPool().getAABB(par1 + 36.0D, par3 + 48.0D, par5 + 36.0D, par7 + 36.0D, par9 + 48.0D, par11 + 36.0D); } }
  12. tried a bunch can't figure this out!
  13. Okay... I have been trying for like an hour and couldn't find anything and i'm using the code from GalaticCraft
  14. okay, i'll try it EDIT: Tried it... Didn't Work Here is the code: @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) { switch (world.getBlockMetadata(x, y, z)) { case 0: return AxisAlignedBB.getAABBPool().getAABB(this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ); case 2: return AxisAlignedBB.getAABBPool().getAABB(this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ); default: return AxisAlignedBB.getAABBPool().getAABB(36.0D, 48.0D, 36.0D, 36.0D, 48.0D, 36.0D); } } @Override @SideOnly(Side.CLIENT) public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) { switch (world.getBlockMetadata(x, y, z)) { case 0: return AxisAlignedBB.getAABBPool().getAABB(this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ); case 2: return AxisAlignedBB.getAABBPool().getAABB(this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ); default: return AxisAlignedBB.getAABBPool().getAABB(36.0D, 48.0D, 36.0D, 36.0D, 48.0D, 36.0D); } } It removed the model and just made a regular block that I was able to walk through
  15. Okay so for the cases I changed it. here is the new code: @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) { switch (world.getBlockMetadata(x, y, z)) { case 0: return AxisAlignedBB.getAABBPool().getAABB(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ); case 2: return AxisAlignedBB.getAABBPool().getAABB(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ); default: return AxisAlignedBB.getAABBPool().getAABB(x + 36.0D, y + 48.0D, z + 36.0D, x + 36.0D, y + 48.0D, z + 36.0D); } } @Override @SideOnly(Side.CLIENT) public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) { switch (world.getBlockMetadata(x, y, z)) { case 0: return AxisAlignedBB.getAABBPool().getAABB(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ); case 2: return AxisAlignedBB.getAABBPool().getAABB(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ); default: return AxisAlignedBB.getAABBPool().getAABB(x + 36.0D, y + 48.0D, z + 36.0D, x + 36.0D, y + 48.0D, z + 36.0D); } } But it still does nothing. and for the second thing you said how do i exactly fix that?
  16. Oh, because the AABB code does nothing. I think it is because of the regular block that is inside my model
  17. The source code can no longer be found in the new forge.
  18. This is my AABB code that I'm using, it's in my Block class: @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) { switch (world.getBlockMetadata(x, y, z)) { case 0: return AxisAlignedBB.getAABBPool().getAABB(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ); case 2: return AxisAlignedBB.getAABBPool().getAABB(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ); default: return AxisAlignedBB.getAABBPool().getAABB(x + 36.0D, y + 48.0D, z + 36.0D, x + 36.0D, y + 48.0D, z + 36.0D); } } @Override @SideOnly(Side.CLIENT) public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) { switch (world.getBlockMetadata(x, y, z)) { case 0: return AxisAlignedBB.getAABBPool().getAABB(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ); case 2: return AxisAlignedBB.getAABBPool().getAABB(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ); default: return AxisAlignedBB.getAABBPool().getAABB(x + 36.0D, y + 48.0D, z + 36.0D, x + 36.0D, y + 48.0D, z + 36.0D); } }
  19. okay so I found a video about AABB Collision Detection and it was for a 2D Indie Game. Not sure if it is the same but I'll try it, but I don't understand it much.
  20. Okay so I saw the code and I am completely lost... can you give me an example of how to use the code? this is what I found: /** * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the * mask.) Parameters: World, X, Y, Z, mask, list, colliding entity */ public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { AxisAlignedBB axisalignedbb1 = this.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4); if (axisalignedbb1 != null && par5AxisAlignedBB.intersectsWith(axisalignedbb1)) { par6List.add(axisalignedbb1); } } and this is code to set it: getCollisionBoundingBoxFromPool(par1World, par2, par3, par4);

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.