Posted January 17, 201510 yr Ive been working on a mod of mine and I know its silly but ive been trying to get this damn lantern working for the past 3 hours. If you guys could help with the code a bit it would mean a lot. MAIN PROBLEM: No hitbox, I can run right through it and I cant break it. CODE: package com.example.DerpTesting.blocks; import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; public class BlockLantern extends Block { public BlockLantern(int i, Material material) { super (material); this.setStepSound(soundTypeGlass); this.setHardness(1.0f); this.setResistance(6f); this.setBlockName("Lantern"); this.setBlockTextureName("derptesting:Block_Lantern"); this.setLightLevel(0.7f); this.setLightOpacity(16); this.setBlockBounds(0.2f, 1f, 0.8f, 0.8f, 0f, 0.2f); //double x = this.getBlockBoundsMaxX(); //double y = this.getBlockBoundsMaxY(); //double z = this.getBlockBoundsMaxZ(); } public boolean isOpaqueCube(){ return false; } public boolean renderAsNormalBlock() { return true; } //public int getRenderType(){ //return 1; //} } ~ExtendedHorizons
January 17, 201510 yr And...what seems to be the problem? Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
January 17, 201510 yr Author Theres no hitbox... I cant break it and I can run right through it ~ExtendedHorizons
January 17, 201510 yr 1. Why are you taking and integer as a parameter for the constructor? 2. Are you using the right constructor when you initialize the block? Don't make mods if you don't know Java. Check out my website: http://shadowfacts.net Developer of many mods
January 17, 201510 yr Author Im using the right constructor and I dont even know why I have an integer there I guess I wasnt paying attention. ~ExtendedHorizons
January 17, 201510 yr Switch 1f with 0f when you call setBlockBounds() the first one should be the minimum x and the second one should be the maximum x, it looks like you have these flipped. Don't make mods if you don't know Java. Check out my website: http://shadowfacts.net Developer of many mods
January 17, 201510 yr For the setBlockBounds() I thought the parameters were: minX, minY, minZ, maxX, maxY, maxZ. That is what I thought if not thanks for telling me shadowfacts. - FireDrgn
January 17, 201510 yr FireDrgn, that is the correct order for the parameters, ExtendedHorizons just had minY and maxY reversed. Don't make mods if you don't know Java. Check out my website: http://shadowfacts.net Developer of many mods
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.