Jump to content

coolboy4531

Members
  • Posts

    584
  • Joined

  • Last visited

Everything posted by coolboy4531

  1. Learn java. You need to declare those fields and things like that. You can override that method in your Block class.
  2. Check if the player is holding the shield, then use LivingHurtEvent to lower damage taken.
  3. Spawn an EntityItem in the world (simple as that). event.world.spawnEntityInWorld(new EntityItem(event.world, event.x, event.y, event.z, new ItemStack(YOUR_ITEM)));
  4. Don't know the cause, but I usually put my events in PreInit (see if that makes a difference - in fact, I never use Init, only PreInit for everything). Another thing: - Try adding System.out.println methods around that event and see if it's actually being called. It could be side issues. EDIT: I think I may have found your issue. HarvestDropsEvent is only called when an item is "dropped" from your block (in this case: saplings or apples). Since leaves only drop those items in a low chance, it will only drop your item (which is a stick) if it drops a sapling or apple of itself. To fix this issue you should not use HarvestDropsEvent and use BreakEvent, I think you can figure which "BreakEvent" to use. (lazy: BlockEvent.BreakEvent)
  5. Show us the entire class, and how you registered that class in your main mod file.
  6. Use Java Reflection. http://docs.oracle.com/javase/tutorial/reflect/
  7. Two things. You haven't even set a texture location (path) for your item, no wonder it shows a missing texture. If I remember you need to bind/set both models and textures to "that" specific item. Take a look at this. Although it's outdated, I bet you can find a way to work around the methods and things. c:
  8. One thing to note. Don't register or create blocks/items during class construction <clinit>. You need to do them like you did with your creative tab. Example: public static Block block; @EventHandler public void preInit(PreInitializationEvent event) { block = new TutorialBlock().setUnlocalizedName("tutBlock"); } //Note: This is an "example."\\
  9. We won't show you an example, you need to learn how to do it c: Show us the code you used (that causes a game crash) and we can guide you through the process and your mistakes.
  10. I think that this is null. (thrown by NullPointerException) ItemStack itemstack = Periodicsystem.getSmeltingResult(slots[0].getItem(), slots[1].getItem(),slots[2].getItem(),slots[2].getItem(),slots[3].getItem(),slots[4].getItem()); You have created the ItemStack[] "slots" but who knows what that .getItem() can be, you've never arranged it.
  11. You shouldn't use programs (generators) to get code. You need to do it manually. Loops are statements that you call that sets a value until it is stopped by an integer you set. Example: for (int i = 0; i < 30; i++) { world.setBlock(x + i, y, z); } //It adds world.setBlock (however many times you put as that integer, in this case 30).
  12. Check whether the mouse is hovering over your item, then display a special GUI. Look at Item#addInformation for resources and help.
  13. Give me what you have right now, and let me see if you "actually" did what we wanted c: Thanks.
  14. For the last time bro. You need to register your event class not the frickin' event itself. You don't know what a handler is - let's just say the class that has the event. Read my last post please.
  15. If you're using 1.7.2, you shouldn't be creating blocks/items during class construction and all your registration and things go into PreInit.
  16. Yeah that was my fault. Sorry! I didn't realize your class name was LivingDropEvent, lol I mis-read it.
  17. You need to "register" that class in your main class. Don't know how? Okay. Let me show you. Do you have a main class? (with the PreInit stuff) If you do, then in that place use the MinecraftForge eventbus. Example: //Note that this is an example and that you should only use the registration method I put in preInit. public void preInit(FMLPreInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new YourEventClass()); //in your case would be LivingDropsEvent } Hey, btw. Aren't you from PMC? lol. I think I may know you.
  18. Try taking a look at EntityZombie itself, see how it picks villagers or players to attack. c:
  19. 2 things. 1) Have you registered your TickListener in your main class? 2) If you are trying to send an entity to the NullVoid dimension after they fall down, you don't check IF that are at the dimension you need to frickin' SEND them to the dimension.
  20. Did you register that event in your main class? Remember you need to test it on a cow because you are doing it that way. I suggest you do exactly what coolAlias suggested as it will make your class less messy and easier to read.
×
×
  • Create New...

Important Information

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