NPC Shop

Discussion in 'Plugin Requests' started by JannickEnzo, Feb 12, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    JannickEnzo

    Hey! I need a plugin that lets me buy thing from a NPC, but it needs to cost a item, because in my RPG Game, you have Golden Nuggets as money, And it needs to disepeer in your inventory when you buy something from the Npc, Maybe already excisting this? I searched and only saw economy buys and not let you cost items,
    Thanks!
     
  2. Offline

    Puzikovs

    Something that will anybody else tell you, would be great if you would fill the form for these requests. Thanks.
     
  3. Offline

    pie_flavor

    @JannickEnzo How would you spawn the NPC, and what would it be?
     
  4. Offline

    JannickEnzo

    @pie_flavor You can do with a command set the NPC's Id, if thats possible! so if the NPC you want a speficiek shop you set it on ID: 22 (example), And the item needs to be Golden Nuggets, But it would be nice if you can change that
     
  5. Offline

    pie_flavor

  6. Offline

    JannickEnzo

    @pie_flavor Every NPC has a ID number wich NPC They are, so NPC ID:22 is the 22 made in the server,
     
  7. Offline

    pie_flavor

    @JannickEnzo Do you use a custom plugin for NPCs? Because the only ID I can think of for entities would be UUID.
     
  8. Offline

    JannickEnzo

    http://prntscr.com/a2j18d No its the orginal Citizens, But look at the printscreen the informatie of the NPC there is a ID
     
  9. Offline

    pie_flavor

  10. Offline

    JannickEnzo

  11. Offline

    pie_flavor

    @JannickEnzo The names are meaningless, but devs need to know what plugins they'd need to be working with.
     
  12. Offline

    JannickEnzo

  13. Offline

    pie_flavor

    @JannickEnzo Yes, I've already started.
    Update: Finished the plugin. Testing it now.
     
    Last edited: Feb 12, 2016
  14. Offline

    JannickEnzo

  15. Offline

    pie_flavor

    @JannickEnzo Finished! NPCShop.jar
    A couple of notes:
    Making the config editable through commands would have taken a lot more effort, so I opted to not include it. If you still want it, tell me.
    If you edit the config while the game is running, you can type /npcshop-reload to reload the shops.
    My initial design was so that you couldn't change the top inventory, but you could still click in your inventory, and when you bought the item, it would essentially clone it onto your cursor. Bukkit proceeded to break everything by refusing to keep them from modifying the top inventory at completely random points. That is why it is currently just making the item appear in your inventory.
    I use Bukkit's default encoding for ItemStacks in the config. The format is here.
     
    Last edited: Feb 13, 2016
  16. Offline

    JannickEnzo

    @pie_flavor Omg thank you very much!!!! Youre the best! but can you make that i can change the language? maybe you saw my bad english, but im Dutch :)
     
  17. Offline

    pie_flavor

  18. Offline

    JannickEnzo

    @pie_flavor Hey maybe you can make, That NPC can buy things from you to, so 1 Fish for 9 Nuggets, Player gets the 9 Nuggets and the npc the fish :)
     
  19. Offline

    pie_flavor

    @JannickEnzo Updated with a lang.yml file where you can change the messages.
    Also, how would the buying work?
     
  20. Offline

    JannickEnzo

    @pie_flavor Nevermind, I dont want that anymore Npc can buy something from you anymore and nice that the Language is fixed!, But i think i found a bug, when i add a nother item so there are 2 items the npc is selling, the item dont show in the npc's shop, but you can buy it
     
  21. Offline

    pie_flavor

    @JannickEnzo Please clarify. How can you buy an item you can't see? And remember, /npcshop-reload to reload all shops.
     
  22. Offline

    JannickEnzo

    @pie_flavor You don't see the item but when you go with your cursor over, popups that how mony Gold its cost :S
     
  23. Offline

    pie_flavor

    @JannickEnzo Seeing as how that's not possible if there's no item there, I'm going to guess that's a resource pack problem.
     
  24. Offline

    JannickEnzo

    @pie_flavor http://prntscr.com/a3p36f I cliked next to the coal, i set there a item in the comfig, and it says in the chat i dont have enough, and when i have enough the item stils dont get!

    @pie_flavor I dont use a resource pack

    http://prntscr.com/a3p69b this is the comfig

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Feb 17, 2016
  25. Offline

    pie_flavor

    @JannickEnzo found the problem
    it has to do with Bukkit's Material system
    Material.CARROT is the carrot crop
    use CARROT_ITEM in the config instead of CARROT
     
  26. Offline

    JannickEnzo

    @pie_flavor Ah oke! Thanks! Can i have the updated pl? with langque file?
     
  27. Offline

    pie_flavor

    @JannickEnzo there wasn't an update. just use CARROT_ITEM in your config instead of CARROT
     
Thread Status:
Not open for further replies.

Share This Page