#(boringmosk) Enchantment Script Container

12 messages · Page 1 of 1 (latest)

cyan siren
#

In the script container there's a section for "events" like:

  • after attack
  • after hurt
    But it seems like a useless part for Tools enchantment...
    Is this only some kind of example and there's other "events" that can be specified here or it's only those two?
small gazelleBOT
#

(boringmosk) Enchantment Script Container

small gazelleBOT
#

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.

noble vector
#

it's only those two. if you want to listen for others, you can use something like a "player breaks block" event with a check to see if their held item has an enchantment

cyan siren
#

Yeah I Understand how to listen to other event. But it seems like a incomplete feature for the Enchantment script...

noble vector
#

i mean, aya's working on a 1.21 compatible version of enchantment scripts. i'll leave this to him to see if this is something he wants to add it, but i don't think it's likely since there's already events for whatever those events would be

cyan siren
#

Yeah That's what i'm thinking. It could have been only the enchantment script and a other one for the events listening...

#

do you know some script that I can use as a example?

noble vector
#

!e player breaks block

pseudo ploverBOT
# noble vector !e player breaks block
Group

Player

Event Lines

player breaks block player breaks <material>

Switches

with:<item> to only process the event when the player is breaking the block with a specified item.

Triggers

when a player breaks a block.

Has Player

Always. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.

Context

<context.location> returns the LocationTag the block was broken at.
<context.material> returns the MaterialTag of the block that was broken.
<context.xp> returns how much XP will be dropped.
<context.should_drop_items> returns whether the event will drop items.

Determine

"NOTHING" to make the block drop no items.
ListTag(ItemTag) to make the block drop a specified list of items.
ElementTag(Number) to set the amount of xp to drop.

Has Known Location

True - this adds switches in:<area> + location_flagged:<flag name>.

Cancellable

True - this adds <context.cancelled> and determines cancelled + cancelled:false.

cyan siren
#

Yeah Ok I know that. AnyWay Thanks for your time.