Jump to content
  • Home
  • Files
  • Docs
  • Merch
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Minecraft Forge
  • General Discussion
  • [1.3] Villager Trading
Sign in to follow this  
Followers 0
Shadowclaimer

[1.3] Villager Trading

By Shadowclaimer, July 31, 2012 in General Discussion

  • Reply to this topic
  • Start new topic

Recommended Posts

Shadowclaimer    0

Shadowclaimer

Shadowclaimer    0

  • Tree Puncher
  • Shadowclaimer
  • Forge Modder
  • 0
  • 15 posts
Posted July 31, 2012

So I haven't had a chance to peek in on the code yet, but I'm curious. How did Mojang handle this and how editable is it? Is it ridiculously hardcoded or can we change up the currencies or implement new trades without much hassle? And does Forge have any plans for hooks related to it?

  • Quote

Share this post


Link to post
Share on other sites

atrain99    68

atrain99

atrain99    68

  • World Shaper
  • atrain99
  • Forge Modder
  • 68
  • 1502 posts
Posted July 31, 2012

Well, the villagers were probably totally rewritten. And it's pretty simple to do something like trading, just have to know how to make entities have GUI's.

If forge doesn't add a hook, I'll be surprised.

  • Quote

Share this post


Link to post
Share on other sites

hotrods20    8

hotrods20

hotrods20    8

  • Creeper Killer
  • hotrods20
  • Members
  • 8
  • 197 posts
Posted July 31, 2012

By testing the trading system, the trades are almost always the same.  If you have 2 farmers and you trade with them for a while.  You will soon notice they share identical trades.  Might be really easy to trade with them.

  • Quote

Share this post


Link to post
Share on other sites

Shadowclaimer    0

Shadowclaimer

Shadowclaimer    0

  • Tree Puncher
  • Shadowclaimer
  • Forge Modder
  • 0
  • 15 posts
Posted August 1, 2012

Well, the villagers were probably totally rewritten. And it's pretty simple to do something like trading, just have to know how to make entities have GUI's.

If forge doesn't add a hook, I'll be surprised.

 

That was my thought on the matter as well.

 

The reason I ask is that my primary mod (Metallurgy) has custom coins and such, and I was wanting to see about implementing new trades in the system and I was curious how Mojang implemented it (IE: how the code was laid out).

  • Quote

Share this post


Link to post
Share on other sites

calclavia    81

calclavia

calclavia    81

  • World Shaper
  • calclavia
  • Forge Modder
  • 81
  • 2281 posts
Posted August 1, 2012

Hmmm. Forge gotta have a hook for trading because some of the items in my mod should be tradable.

  • Quote

Share this post


Link to post
Share on other sites

hotrods20    8

hotrods20

hotrods20    8

  • Creeper Killer
  • hotrods20
  • Members
  • 8
  • 197 posts
Posted August 1, 2012

It is possibly really easy to create or add a new currency to the game.

  • Quote

Share this post


Link to post
Share on other sites

atrain99    68

atrain99

atrain99    68

  • World Shaper
  • atrain99
  • Forge Modder
  • 68
  • 1502 posts
Posted August 3, 2012

It is possibly really easy to create or add a new currency to the game.

Well, forge should have a hook for it (hint, hint), but if there isn't, go ahead and write one and submit a pull request to forge on github.

  • Quote

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 0
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • saxon564
      [1.14.4] [UNSOLVED] Server Thread Freezes After Entity Explodes

      By saxon564 · Posted 12 minutes ago

      Unfortunately that was not the case, there was no change in the result at all.
    • CanadaMan
      illegal wheat?

      By CanadaMan · Posted 1 hour ago

    • CanadaMan
      illegal wheat?

      By CanadaMan · Posted 1 hour ago

      Okay so I'm trying to join one of my friends modded server and it said that illegal state of wheat was stopping me from joining
    • MrNoodles75
      [1.14.3] send message to chat

      By MrNoodles75 · Posted 1 hour ago

      @Draco18s I have been figuring everything out since then, by going through the default code and getting information on how to do something
    • AntonBespoiasov
      attackEntityFrom() doesn't work. 1.12.2

      By AntonBespoiasov · Posted 2 hours ago

      public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityLivingBase entityLiving) { Entity entity = ModMath.getMouseOver(Minecraft.getMinecraft().getRenderPartialTicks(), 0); // Gets entity that entityLiving is looking at if (entity != null && entity instanceof EntityLiving) { ((EntityLiving)entity).attackEntityFrom(DamageSource.MAGIC, 2.0f); ((EntityLiving)entity).setRevengeTarget(entityLiving); } return stack; }   Using item that has the implementation of the method above doesn't damage entity. Debugging it showed that attackEntityFrom() is called, code within if statement is executed but entity isn't attacked. I looked into Minecraft's files that use attackEntityFrom() and observed that they just call attackEntityFrom(), just one line of code(I assume that something else that can affect entity attacking process was called before attackEntityFrom() in that files). How can I solve this problem? How can I deal damage to entity?
  • Topics

    • saxon564
      9
      [1.14.4] [UNSOLVED] Server Thread Freezes After Entity Explodes

      By saxon564
      Started Friday at 05:11 AM

    • CanadaMan
      1
      illegal wheat?

      By CanadaMan
      Started 1 hour ago

    • MrNoodles75
      17
      [1.14.3] send message to chat

      By MrNoodles75
      Started Monday at 08:19 PM

    • AntonBespoiasov
      0
      attackEntityFrom() doesn't work. 1.12.2

      By AntonBespoiasov
      Started 2 hours ago

    • Lordyammer
      1
      How to start learning

      By Lordyammer
      Started 4 hours ago

  • Who's Online (See full list)

    • Naiakoa
    • fuzzyweapon
    • ShetiPhian
    • The_Unkown675
    • Trhod177
    • plugsmustard
    • Lea9ue
    • saxon564
    • DaemonUmbra
  • All Activity
  • Home
  • Minecraft Forge
  • General Discussion
  • [1.3] Villager Trading
  • Theme
  • Contact Us
  • Discord

Copyright © 2019 ForgeDevelopment LLC · Ads by Curse Powered by Invision Community