Jump to content

zenglintao

Members
  • Posts

    23
  • Joined

  • Last visited

Everything posted by zenglintao

  1. I often see the word Vanilla, but I don’t know what it is, can anyone tell me?
  2. public class MyItem extends Item { public MyItem() { super(new Properties().group(ItemGroup.MATERIALS)); } public ActionResult<ItemStack> onItemRightClick(World worldIn, PlayerEntity playerIn, Hand handIn) { playerIn.sendMessage(); if (this.isFood()) { ItemStack itemstack = playerIn.getHeldItem(handIn); if (playerIn.canEat(this.getFood().canEatWhenFull())) { playerIn.setActiveHand(handIn); return ActionResult.resultConsume(itemstack); } else { return ActionResult.resultFail(itemstack); } } else { return ActionResult.resultPass(playerIn.getHeldItem(handIn)); } } } I override the onItemRightClick method in my item class
  3. public void sendMessage(ITextComponent component) { } It is an empty method, I don't know how to use it. ITextComponent is an interface
  4. But what is ITextComponent?
  5. Ok, I want to send a message
  6. What method is used to replace onLeftClickEntity in the new version of Forge?
  7. <image of vanilla code removed - diesieben07>
  8. Shouldn't you use a Player object to do that?
  9. I used the old version of Forge to write a simple item for sending messages, but I don’t know how to write these code in the new version of Forge.
  10. Um, i got it. Thanks
  11. okay, thank you
  12. How does the 1.15x version of Forge send messages?
  13. Why do many method names change after forge upgrade, do I have to remember those method names again?
  14. https://wiki.mcjty.eu/modding/index.php?title=Main_Page This tutorial is more detailed than the official one, but it's video format, I prefer to read the documentation
  15. I have learned Java, but there are too few official examples
  16. This document is not detailed enough, there are too few examples
  17. I want to know how to create and register an Events
  18. How do you know how many methods Forge has and what they are used for?
×
×
  • Create New...

Important Information

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