Jump to content

brandon3055

Forge Modder
  • Posts

    444
  • Joined

  • Last visited

Everything posted by brandon3055

  1. Because part of the way minecraft checks if an item is enchantable is wit this method public boolean isItemTool(ItemStack p_77616_1_) { return this.getItemStackLimit(p_77616_1_) == 1 && this.isDamageable(); } to fix your problem you need to override isItemTool in your item class and return true.
  2. iff you are sending packets to the server for control and thats where you need the entity in your message handler you can get the plater that sent the packet using. messageContext.getServerHandler().playerEntity
  3. why cant you just use player.ridingEntity to get the entity the player is riding?
  4. Oh i see its in the wrong spot it should be here if (playersWithFlight.get(player) && !player.worldObj.isRemote) { //<--- playersWithFlight.put(player, false); if (!player.capabilities.isCreativeMode) { player.capabilities.allowFlying = false; player.capabilities.isFlying = false; player.sendPlayerAbilities(); } } But if its working for you it probably dosnt matter.
  5. Your most welcome! Infact i think you should remove the isRemote altogether
  6. OOOh change if (event.phase != TickEvent.Phase.START || event.player.worldObj.isRemote) return; to if (event.phase != TickEvent.Phase.START || !event.player.worldObj.isRemote) return; and that should do the trick. Edit infact remove the isRemote altogether if (event.phase != TickEvent.Phase.START) return;
  7. Ok it worked as we planned When it was on: Equipment Stack 1xitem.GravityChestplate@0 Item com.skullcrusher.BetterThings.Armor.GravityArmor@4aa33ead Target Item com.skullcrusher.BetterThings.Armor.GravityArmor@4aa33ead true When it was off: Equipment Stack null Target Item com.skullcrusher.BetterThings.Armor.GravityArmor@4aa33ead false did you copy just the changes or the entire class?
  8. Hmmm.... try putting printlns in both sides of the main if statement (the one that sets weather or not the player can fly) and see which one is called
  9. It has nothing todo with the item class... i assume yoy checked if you can fly now?
  10. i think i see the problem can you please show me your moditems class (where you have you instance of GravityChestplate) Edit:wait... i dont see the problem... that should work
  11. Ok thats a bit of a mess... Try this i think i fixed the null pointer and may have figured out why it isnt working.
  12. Oops another typo it should be event.player.getEquipmentInSlot(3) Didnt it give you an error on that line?
  13. "Raze_carbondrop" is not an item it is your ModItem class try Raze_carbondrop.CDrop
  14. oops remove .getItem() from the first System.out so System.out.println("Equipment Stack "+getEquipmentInSlot(3)); if (event.player.getEquipmentInSlot(3) != null) System.out.println("Item "+event.player.getEquipmentInSlot(3).getItem()); System.out.println("Target Item"+BetterThings.GravityChestplate); if (event.player.getEquipmentInSlot(3) != null && event.player.getEquipmentInSlot(3).getItem() == BetterThings.GravityChestplate) and make sure you are wearing the chestplate it crashed because it tried to get the item from the stack in your chestplate slot but that stack was null.
  15. In future try to give more detail in your first post then just "Its not working. Help me fix it"
  16. I think toy need to actually create an item class that extends Item. What you have done there may be possible but i have never seen it done before. And you still havent clarified the problem do you mean the block dosnt drop that item when you break it?
  17. I dont believe the method you are looking for exists. You may have to just use an event handler.
  18. There are two ways of registering event handlers the MinecraftForge event is the 2nd way FMLCommonHandler.instance().bus().register(new ClassName()) is another way. Thats kinda correct. There are multiple different event busses MinecraftForge.EVENT_BUS and FMLCommonHandler.instance().bus() are just 2 of therm and they each handle different events so you need to register your event to the correct buss which in this case is FMLCommonHandler.instance().bus() And he isnt working on the client side. @OP Well you are closer atleast try adding System.out.println("Equipment Stack "+getEquipmentInSlot(3).getItem()); if (event.player.getEquipmentInSlot(3) != null) System.out.println("Item "+event.player.getEquipmentInSlot(3).getItem()); System.out.println("Target Item"+BetterThings.GravityChestplate); if (event.player.getEquipmentInSlot(3) != null && event.player.getEquipmentInSlot(3).getItem() == BetterThings.GravityChestplate) bellow if (event.phase != TickEvent.Phase.START || event.player.worldObj.isRemote) return; and tell me what is printed to the console.
  19. Just to clarify what The_Fireplace said (which is 100% correct) nei scans all mods loaded for a class named NEI[some name]Config and calls the "loadConfig()" method within it. For this to work you need to add nei to your workspace as a library.
  20. I may be wrong but it dosnt look like there is... atleast no easy way your best bet is probably to just replace it.
  21. The armor class dosnt need to know anything. It is the ArmorEventHandler that detects if the players is wearing the chestplate and sets weather or not they can fly.
  22. That is where the @SubscribeEvent public void onEntityUpdate(PlayerTickEvent event) method is supposed to be...
  23. I just checked some code i used to ass velocity to an entity and i used entity.addVelocity(d2 / d4 * 8.0D, 5.20000000298023224D, d3 / d4 * 8.0D); entity.velocityChanged = true; so maby try entity.setVelocity(0D, 0D, 0D); entity.velocityChanged = true; Edit: i just threw that into my LivingUpdateEvent handler and it froze every entity in the world so if it dosnt work you you it must be as you said "the block's update loop is being called before the entity"
×
×
  • Create New...

Important Information

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