
zenglintao
Members-
Posts
23 -
Joined
-
Last visited
Everything posted by zenglintao
-
I often see the word Vanilla, but I don’t know what it is, can anyone tell me?
-
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
-
public void sendMessage(ITextComponent component) { } It is an empty method, I don't know how to use it. ITextComponent is an interface
-
But what is ITextComponent?
-
Ok, I want to send a message
-
About The WorldGenTrees Class Was Outdated
zenglintao replied to Luo_Shijian's topic in Modder Support
Like This? -
About The WorldGenTrees Class Was Outdated
zenglintao replied to Luo_Shijian's topic in Modder Support
-
About The WorldGenTrees Class Was Outdated
zenglintao replied to Luo_Shijian's topic in Modder Support
<image of vanilla code removed - diesieben07> -
Shouldn't you use a Player object to do that?
-
Um, i got it. Thanks
-
okay, thank you
-
How does the 1.15x version of Forge send messages?
-
Why do many method names change after forge upgrade, do I have to remember those method names again?
-
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
-
I have learned Java, but there are too few official examples
-
This document is not detailed enough, there are too few examples
-
How do you know how many methods Forge has and what they are used for?