#(its_thomz) How to let an NPC give an enchanted item?

42 messages · Page 1 of 1 (latest)

thick trench
#

Hi,

I searched in the docs but couldn't find any information.

I have a NPC that i want to give players special items when they find him like enchanted swords and stuff like that.

But i'm not ably to find how to give an enchanted sword for example. I know the command is give [item] players.<player> quantity:1 but when i do sword as item, it isn't enchanted.

Can someone help??

weak runeBOT
#

(its_thomz) How to let an NPC give an enchanted item?

weak runeBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.

modest cloak
#

you can specify an ItemTag to put into the [item] argument

#

!l item script container

candid dawnBOT
# modest cloak !l item script container

Item script containers are an easy way to pre-define custom items for use within scripts. Item
scripts work with the ItemTag object, and can be fetched with the Object Fetcher by using the
ItemTag constructor ItemTag_script_name. Example: - drop <player.location> super_dooper_diamond

The following is the format for the container. Except for the 'material' key (and the dScript
required 'type' key), all other keys are optional.


# The name of the item script is the same name that you can use to construct a new
# ItemTag based on this item script. For example, an item script named 'sword_of_swiftness'
# can be referred to as simply 'sword_of_swiftness'.
Item_Script_Name:

    type: item

    # Must be a valid ItemTag. See 'ItemTag' for more information.
    # | All item scripts MUST h

...

Group

Script Container System

candid dawnBOT
flat stratus
#

could you send us your script to we can point the issue out

thick trench
#

i don't have a script yet because i don't know how.

I have a script that, when a player finishes a quest, they get money

- money give quantity:100

But instead of money, i want to give an enchanted sword (for example)

knotty niche
#

!m enchantment

candid dawnBOT
#
Possible Confusion

Did you mean to search for command assignment?

knotty niche
#

why the fuck would i want assignment command

#

!m itemtag.enchantments

candid dawnBOT
# knotty niche !m itemtag.enchantments

Sets the item's enchantments as a map of EnchantmentTags or enchantment names to level.
For example: - inventory adjust slot:hand enchantments:sharpness=1
Does not remove existing enchantments, for that use !mechanism ItemTag.remove_enchantments

Object

ItemTag

Input

MapTag

Tags

<ItemTag.enchantment_map> Returns a map of enchantments on the item. Map keys are enchantment name...

knotty niche
young pastureBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.

If not yet resolved, please reply below to tell us what you still need.

(Note that if there is no reply for a few days, this thread will eventually close itself.)

#

@thick trench

thick trench
#

Sorry, still trying but i can't seem to get it working..

candid dawnBOT
modest cloak
#

@thick trench ^

young pastureBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.

If not yet resolved, please reply below to tell us what you still need.

(Note that if there is no reply for a few days, this thread will eventually close itself.)

#

@thick trench

thick trench
#

Sorry, still trying, didn't had much time last couple of days due to work

remote granite
thick trench
digital linden
# thick trench i can't figure out how to get it to work. i'm pretty new to denizen and there is...

If you have a script then please paste it as asked prior.

You're attempting to give an enchanted sword right? This is a little more complicated since you'll have to attach an enchantment map to a defined item or the item right there in the give command.

Alternatively, if you want to make this item more unique you can make your own custom item in denizen with the Item Script Container, and give it enchantments through this.

#

Is this just going to be a generic sword with enchantments on it, or are you going to make it something custom?

thick trench
#

i don't have a script because i don't even know where to start,
i tried thru console first but even there it wont work.

It could be a sword or pickage with some enchantments on it.

grave zephyr
#

You should start by going through the beginner’s guide. It’ll take a couple of days to do it right but you’ll learn a ton and you will learn exactly how to begin your enchanted sword idea.

#

!guide

candid dawnBOT
grave zephyr
#

We can help when you get stuck.

modest cloak
#

I'd advise looking over item script containers and the enchantment section in them

#

!l item script containers

candid dawnBOT
# modest cloak !l item script containers

Item script containers are an easy way to pre-define custom items for use within scripts. Item
scripts work with the ItemTag object, and can be fetched with the Object Fetcher by using the
ItemTag constructor ItemTag_script_name. Example: - drop <player.location> super_dooper_diamond

The following is the format for the container. Except for the 'material' key (and the dScript
required 'type' key), all other keys are optional.


# The name of the item script is the same name that you can use to construct a new
# ItemTag based on this item script. For example, an item script named 'sword_of_swiftness'
# can be referred to as simply 'sword_of_swiftness'.
Item_Script_Name:

    type: item

    # Must be a valid ItemTag. See 'ItemTag' for more information.
    # | All item scripts MUST h

...

Group

Script Container System

modest cloak
#

As Chaps said, we'll be happy to help if you have questions related to formatting or implementation

young pastureBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.

If not yet resolved, please reply below to tell us what you still need.

(Note that if there is no reply for a few days, this thread will eventually close itself.)

#

@thick trench