CitizensDev / Citizens2

Citizens - the premier plugin and API for creating server-side NPCs in Minecraft.
https://citizensnpcs.co
Open Software License 3.0
589 stars 313 forks source link

"/NPC Command" Item Cost #2369

Closed Jecyn closed 3 years ago

Jecyn commented 4 years ago

The output of command /version on my server is: https://gyazo.com/6729fdaa7cc1ac952e1d9b3d2dad2674 The output of command /version citizens on my server is: https://gyazo.com/c7b0aad78b8ffaf052791f3cd381177f

Make the command /npc command cost [xxx] be able to take (custom) items as cost

Jecyn commented 4 years ago

idk how to add the feature request tag, sorry :P

mcmonkey4eva commented 4 years ago

For some reason GitHub only allows repo admins to use the label system.

I edited your post to contain your requested feature, and your title to be... er, a title.


While this does make sense as a potential feature for /npc command, this is possibly a case where you might prefer to use something like a Denizen script. Denizen is a scripting engine meant to directly work with Citizens so you can perform more advanced customized actions, rather than exclusively limited to the set of options that are pre-built. In this case you'd write: an assignment (and/or interact) script container, with something like - if <player.inventory.contains.material[stick]>: followed by something like - take stick, and maybe some narrate commands to say "Took 1 stick" / "You need a stick" or whatever.

Your request mentions "custom" items - if you mean being able to specify which item (stick vs stone vs gold vs whatever) and a quantity, then that's basically it as far as what you need in Denizen, and if added to Citizens would probably be limited to more or less that. If however you mean fully customized items (with names, lores, enchantments, etc) with some form of unique identifier attached to the items (like a quest item), that likely would end up outside the scope of a Citizens feature and at that point fully leans into being a Denizen thing - you can use an item script container to define a custom item, and then just swap the contains tag to <player.inventory.contains.scriptname[my_script_item]> and similar. (Or, if you're already using a separate plugin to define the custom item, write whatever tag forms a valid matcher for it, using NBT or Lore or whatever as applies, though that will be more complicated).

Jecyn commented 4 years ago

Yeah Items with more and enchants stuff was what I meant. Wasn't sure what to call it in post. Denizen sounds interesting though, I'll definitely do some reading up on how it works and maybe try to create something myself. I really appreciate the reply. :)

On Sat, Oct 17, 2020, 6:58 PM mcmonkey4eva notifications@github.com wrote:

For some reason GitHub only allows repo admins to use the label system.

I edited your post to contain your requested feature, and your title to be... er, a title.

While this does make sense as a potential feature for /npc command, this is possibly a case where you might prefer to use something like a Denizen script https://denizenscript.com/. Denizen is a scripting engine meant to directly work with Citizens so you can perform more advanced customized actions, rather than exclusively limited to the set of options that are pre-built. In this case you'd write: an assignment (and/or interact) script container, with something like - if <player.inventory.contains.material[stick]>: followed by something like - take stick, and maybe some narrate commands to say "Took 1 stick" / "You need a stick" or whatever.

Your request mentions "custom" items - if you mean being able to specify which item (stick vs stone vs gold vs whatever) and a quantity, then that's basically it as far as what you need in Denizen, and if added to Citizens would probably be limited to more or less that. If however you mean fully customized items (with names, lores, enchantments, etc) with some form of unique identifier attached to the items (like a quest item), that likely would end up outside the scope of a Citizens feature and at that point fully leans into being a Denizen thing - you can use an item script container to define a custom item, and then just swap the contains tag to <player.inventory.contains.scriptname[my_script_item]> and similar. (Or, if you're already using a separate plugin to define the custom item, write whatever tag forms a valid matcher for it, using NBT or Lore or whatever as applies, though that will be more complicated).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/CitizensDev/Citizens2/issues/2369#issuecomment-711095314, or unsubscribe https://github.com/notifications/unsubscribe-auth/APR2ZI7FMOWSUAFQ5QSEMGLSLIVQ5ANCNFSM4SUMB2QA .