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.

zenglintao

Members
  • 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?

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.