Skip to main content

Ability to trade items with NPCs

Comments

37 comments

  • Tom Banaszewski

    Looks like there's been some great work done to make economics enjoyable for students to learn in MEE. If you're willing to share your worlds, I'm sure there's many teachers like myself who would be very happy to use them with students.

    0
  • Tom Banaszewski

    This is really amazing, especially given the lack of mods in EE. Yes, I'd like to be a beta tester!

     

    0
  • Deb Borba

    I would like to test this also.

    0
  • teacher

    How to return items back to Player Inventory when he has "no money"? I've spent some time to solve this.

    We can use command blocks For/While Loops, same as in this video https://youtu.be/9yX7mhgIhs0

    In LOOP we clear Emeralds or something else from Player's inventiry and count this in scorebpard variable

    Finaly if Player has small amount of "money" we start second LOOP and give Emeralds back one-by-one

    This is flat world with simple solution

    https://drive.google.com/open?id=17KMo2R3zXvNrRotWY28sY7up961O6Sab 

    0
  • teacher

    Hello. I don't tested the 50+ transaction at the same time. I think the best way - clone "LOOP" for every NPS

    About "moneyback" - the best and super quick way to do this - use functions. We can test "Score" with moneyback and make list of commands from 32768 (maximum items in give command). If we store coins in scoreboard "moneyback":

    give @s[scores={moneyback=32768..}] emerald 32768 0
    scoreboard players remove @s[scores={moneyback=32768..}] moneyback 32768

    give @s[scores={moneyback=16384..}] emerald 16384 0
    scoreboard players remove @s[scores={moneyback=16384..}] moneyback 16384

    https://drive.google.com/open?id=1BRq0WEkpXTJMcXMxLZFuu6-G9t7iyKVu 

    Using: import resource pack attached, declare scoreboard moneyback and set some value

    and in command block run /execute @p[x=5,y=4,z=5,r=3] ~ ~ ~ function moneyback

    :) offcource specify Your x,y,z in selector

     

    0
  • Moderator Beacon of Knowledge Super Star

    Perhaps what is missing is a command to know what is in the player's inventory? I can't remember at the moment, but it seems to me that it is hard to test whether or not a player has something or not.

    0
  • Valentina Galvez

    yaa

    0

Please sign in to leave a comment.