Trading

Started by marcell123455 on Wed, 07/13/2016 - 20:51

Topic category: Feature requests and ideas for MCreator

Last seen on 14:21, 22. Sep 2019
Joined Aug 2013
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Trading
Wed, 07/13/2016 - 20:51

Hi guys,
it would be nice if there is something to make a trading gui! or an event if int var (money) is lower than a variable which is the price than dont add item to inventory otherwise add item to inventory.

ps klemen: is there a difference between the minecraft java and normal java what ive been using in unity3d to programming my game?

Last seen on 00:21, 11. Aug 2019
Joined Aug 2013
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • wiki contributor
  • moderator
I think that if you used java
Thu, 07/14/2016 - 10:27

I think that if you used java or C++ in Unity 3d , you propably know that you need something like:

//THIS IS JUST "PSEUDOCODE"

public static void onSlotClicked(){

if(player.money > slot.getItem().price){

slot.canBeClicked(true);

}

 

I recommend you take look on EntityVillager and Villager GUI

To second question , yes there is difference.

1st - In Unity 3d you can make classes as you want  and edit them without any problems.

In Minecraft modding you can not edit minecraft base classes and variable from them you can get for example only:

If there is public function returning the variable or you can use reflection.

Also in Unity 3d you can assign values to variables directly in the object , and diffrences are also in the syntax. In Unity 3d .js you use functions , but in Minecraft modding you use voids like in C++.

Last seen on 14:21, 22. Sep 2019
Joined Aug 2013
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
RE:I think that if you used java
Thu, 07/14/2016 - 21:21

Allright, thanks for your answer. thats good to know, and this type of code is what i mean, yes.

thanks :) it helped