Need help for "Sell Block"

Started by MrExo on Mon, 07/17/2017 - 15:15

Topic category: Advanced modding

Last seen on 06:46, 17. Jan 2019
Joined Jul 2017
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Need help for "Sell Block"
Mon, 07/17/2017 - 15:15

Hello and welcome to my problem.

First of all my english isn't very good.(i hope you can understand it)

I wanted to make a "block" that can be "right klicked" and if the player right klicks it a Shop GUI would pop up.

In this gui is a button called "Sell".If the player press it a Item should be removed from his inventory in this case a Steel Bar (Mod item).

After the Player sold it he should get Money (in this case 10 Mineys) (Mineys is called the money in my mod).

But here the problem come.

First of all here is the "code"

It should consume the "Steel Bar" and after this it should give the Player 1 money.

After the player recieved the money the player shouldn be able to press the button again if he has no "Steel Bars" left  in his inventory.

Here's a Video of the Problem.

https://www.youtube.com/watch?v=bQoNIppH0II&feature=youtu.be

I cant fix it on my own cus i dont have much skills in coding  etc...

Help would be nice :)

 

Last seen on 21:50, 16. May 2019
Joined Jun 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Ok so click create events and
Mon, 07/17/2017 - 16:11

Ok so click create events and then select stack events and before you add it, there is a white box above it. Press the arrow and select hasPlayerInInventory[item/block]. Press stack event and press add item to inventory. This will check if it has the item and give the money. But then you need to get rid of the item as they recieve money so...

 

Add another event where it removes 1 item. If you do anything higher than 1 there will be a bug where you can get money from 1 item instead of 2+ items.

 

Last seen on 06:46, 17. Jan 2019
Joined Jul 2017
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
First of all thank you very
Mon, 07/17/2017 - 19:49

First of all thank you very much.It works now but not really like it should.The player now can sell stuff but there is a wierd bug.I cant explain it in words so take a look here.I have no idea how to fix it :/

https://youtu.be/GmM9X_QWkYs

Last seen on 21:50, 16. May 2019
Joined Jun 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
This bug I am not sure about.
Mon, 07/17/2017 - 20:09

This bug I am not sure about. It seems to be a bug with either minecraft or mcreator.

Last seen on 22:52, 27. Oct 2017
Joined Nov 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
I am not the only one witht
Tue, 07/18/2017 - 10:07

I am not the only one witht that bug THANK fk :) I been getting that same problem tried remaking the mod, tried redownloading everyting, yep I get this very same problem when using the GUI also at times I get the ghost item of 0 size, MCreator at times just can't cut it.

Last seen on 06:46, 17. Jan 2019
Joined Jul 2017
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
RE:I am not the only one witht
Tue, 07/18/2017 - 20:07

@#4 I can't finish my mod when this thing dosent work :/ So let's wait for the new update and hope ! :)

Last seen on 21:50, 16. May 2019
Joined Jun 2015
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
The best thing to do is to
Tue, 07/18/2017 - 20:21

The best thing to do is to report the bug and hopefully it will be fixed.

Last seen on 14:48, 10. Nov 2018
Joined Jul 2017
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
i would add an Input Slot,
Tue, 07/18/2017 - 21:13

i would add an Input Slot, and make it detect if an iron ingot is inside the slot, then it takes one, and gives you your Miney, i could try and recreate this in MCreator and take a pic for you

Last seen on 14:48, 10. Nov 2018
Joined Jul 2017
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Or Steel Ingot in your mod, i
Tue, 07/18/2017 - 21:14

Or Steel Ingot in your mod, i added iron ingot for my 1st thing as thats what i would have used.

Last seen on 06:46, 17. Jan 2019
Joined Jul 2017
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
RE:Or Steel Ingot in your mod, i
Tue, 07/18/2017 - 23:20

@#7 Hmm good idea i will try it :) Would be very cool if you could take a pic :)

Last seen on 14:48, 10. Nov 2018
Joined Jul 2017
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
MrExo, i know you wanted a
Tue, 08/08/2017 - 19:09

MrExo, i know you wanted a GUI, but i managed to recreate something like how you wanted using a block, basically, you make a block, but on Block Rightclicked, make 2 events, 1 giving the item, and one taking the item, AKA: Giving 1 Emerald and Selling 1 Steel Bar, its the best i could do, but its something