Jump to content

jomoetnt

Members
  • Posts

    6
  • Joined

jomoetnt's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Hey everyone! I've been working on this mod where the evil penguins and righteous penguins are at war with each other and recently I took a break. I implemented Capabilities for a float called trust. I'm not too sure why it's not working but it's just doing what it was before as if nothing changed. My event handler: The trust interface: The trust class: The CapabilityHandler: The trust provider: The trust storage: My main class: Any help would be appreciated!
  2. EDIT: I've been told giving people complete code is not acceptable on this forum so I have removed my post.
  3. If you still have problems I have recently been working on a mod and it has a titanium ore block and this is direct code from the constructor: this.blockHardness = 3.0F; this.blockResistance = 3.0F; Resistance refers to explosion resistance and hardness refers to mining with a pickaxe.
  4. I don't know a lot about the topic but here are a few links that might help you: https://www.youtube.com/watch?v=MHgS0GTNqq0 https://www.youtube.com/watch?v=B4HWFG8VJM0 http://jabelarminecraft.blogspot.com/p/minecraft-forge-1721710-gui-and-input.html http://jabelarminecraft.blogspot.com/p/minecraft-modding-block-with-simple-gui.html https://wiki.mcjty.eu/modding/index.php?title=GUI-1.12 Also I think it might help to look at the GUIContainer class. EDIT: I found a step by step guide on this here: https://shadowfacts.net/tutorials/forge-modding-112/tile-entities-inventory-gui/ EDIT 2: I just realized someone else posted the same link.
  5. Hello everyone! I'm making a mod with a story line about a penguin war. The righteous penguins are at war with the evil penguins. You craft a dictionary to be able to understand the penguins so you can do quests for them and talk to them. I am trying to make it so that the penguins' names are consistent, as in the name tag is the same as the name it displays in chat when you talk to them. Inside the PenguinDictionary class: @Override public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) { ItemStack itemstack = playerIn.getHeldItem(handIn); Minecraft mc = Minecraft.getMinecraft(); RayTraceResult objectMouseOver = mc.objectMouseOver; if (delay == 0) { if (itemstack.getItem() == themodtostartallmods.penguinDictionary) { if(mc.objectMouseOver != null && mc.objectMouseOver.entityHit != null) { Entity Target = objectMouseOver.entityHit; if(Target instanceof EntityPenguinRighteous) { if (EntityPenguinRighteous.trust >= 500) { if (Quest.hasQuest == false) { //This part gives me the error playerIn.sendMessage(new TextComponentString(EntityPenguinRighteous.getCustomNameTag() + ": " + Quest.getQuest())); Quest.hasQuest = true; } } else { //This part gives me the error playerIn.sendMessage(new TextComponentString(EntityPenguinRighteous.getCustomNameTag() + ": " + Quest.getDialogue())); EntityPenguinRighteous.trust += 10; } } } } if (Quest.checkIfQuestFinished()) { playerIn.sendMessage(new TextComponentString(Quest.messageWhenDoneQuest())); playerIn.inventory.addItemStackToInventory(new ItemStack(Items.DIAMOND, 1)); EntityPenguinRighteous.trust += 50; Quest.hasQuest = false; } if (Quest.hasQuest) { playerIn.sendMessage(new TextComponentString(Quest.getName() + ": You already have a quest!")); } delay = 50; } return new ActionResult(EnumActionResult.SUCCESS, itemstack); } (Sorry for the long code, I didn't want to leave it out of context) EntityPenguinRighteous.getCustomNameTag() gives me an error because I did not instantiate EntityPenguinRighteous, and I can not instantiate EntityPenguinRighteous without running into the following problems: If I instantiate EntityPenguinRighteous inside of this method it will generate a random name in chat every time you attempt to talk to the penguin. For example: Waddles: You are quite tall! and then if you talk to them again it will say Wiggles: You look funny! when the name tag displays Tux. If I instantiate EntityPenguinRighteous at the top of this class, I need to write this line of code: EntityPenguinRighteous epr = new EntityPenguinRighteous(World); However, I need to pass in a World type, which it does not let me instantiate (It gives me the error World can not be instantiated) and I can only use it if I pass the parameters World worldIn inside a method, which I previously explained I can not do or it would generate a different name each time. If I put the string penguinName inside of the constructor rather than at the top of the class it would not be publicly accessible. Is there any way I could make the chat name display the same string as the name tag? Any help is appreciated!
×
×
  • Create New...

Important Information

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