#(LG_Legacy) Getting when a player is equipped an item through a dispenser.

46 messages · Page 1 of 1 (latest)

abstract tulip
#

https://paste.denizenscript.com/View/119992 - Relevant script

Trying to look into how this is currently possible to do, at the moment I'm using on block dispenses item to check the distance between players and grabbing the closest player, but I'm not sure if I can do better than this? It's not the perfect distance, and I wonder if there is a better way of being able to check when the player is going to be equipped from a dispenser or not since the equipment events are unreliable or cannot be cancelled.

The entire goal of this is to block the player from equipping items if they have specified flags on said items, such as itemtags inside of the itemtag ( Slotted gems, etc. ) primarily but perhaps down the road I'll want other flags to completely block the player from equipping an item. This may also apply to entities as well.

stiff spruceBOT
#

(LG_Legacy) Getting when a player is equipped an item through a dispenser.

stiff spruceBOT
#

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.

abstract tulip
#

Oh you know what? There is a solution.

#

It seems like we're only using this spigot event for the mirror equipment trait for npcs?

subtle gardenBOT
#
Changed to Feature

Thread is now a Feature thread. This indicates a request for a new feature to the plugin, that both (A) does not already exist and (B) reasonably can be added. If you are unsure whether this applies, use </helpthread:1028674284870180883> to change back to a normal help thread.

abstract tulip
#

I don't know what the event would be, probably something like on dispenser equips entity or something.

low tundra
#

!e equips

muted wagonBOT
# low tundra !e equips
Required Plugins or Platforms

Paper

Group

Paper

**WARNING**

This event is not reliable, and may miss some types of equipment changes or fire when equipment hasn't actually changed.

Event Lines

player equips|unequips armor|helmet|chestplate|leggings|boots player equips|unequips <item>

Triggers

when a player (un)equips armor.

Has Player

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

Context

<context.new_item> returns the ItemTag that is now in the slot.
<context.old_item> returns the ItemTag that used to be in the slot.
<context.slot> returns the name of the slot.

low tundra
#

I'm pretty sure this fires for that? if not then yeah that event will probably work

abstract tulip
#

As stated, it's unreliable and not cancellable.

#

So I can't really use that event.

surreal herald
#

!event dispens

muted wagonBOT
surreal herald
#

!event block dispenses item

muted wagonBOT
# surreal herald !event block dispenses item
Group

Block

Event Lines

<block> dispenses <item>

Triggers

when a block dispenses an item.

Context

<context.location> returns the LocationTag of the dispenser.
<context.item> returns the ItemTag of the item being dispensed.
<context.velocity> returns a LocationTag vector of the velocity the item will be shot at.

Determine

LocationTag to set the velocity the item will be shot at.
ItemTag to set the item being shot.

Has Known Location

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

Cancellable

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

surreal herald
#

!event tries to dispense

muted wagonBOT
# surreal herald !event tries to dispense
Group

Block

Event Lines

<block> tries to dispense <item>

Triggers

before a block dispenses an item.
This event fires before the dispenser fully processes a drop, allowing access to the dispensing slot and cancellation of sound effects.

Context

<context.location> returns the LocationTag of the dispenser.
<context.item> returns the ItemTag of the item about to be dispensed.
<context.slot> returns a ElementTag(Number) of the slot that will be dispensed from.

Has Known Location

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

Cancellable

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

surreal herald
#

this is going to be the only other event i believe that manages listening to the dispenser

abstract tulip
#

While I can currently block it, the spigot event I provided gives me exactly what I want. A way to block an entity from being equipped with a dispenser, instead of having it a bit unreliable based on distance. ( I don't know if it'll quip based on the closest person, or just whoever it feels like. )

surreal herald
#

oh i see, so feature request?

abstract tulip
#

Yes.

subtle gardenBOT
#
Changed to Feature

Thread is now a Feature thread. This indicates a request for a new feature to the plugin, that both (A) does not already exist and (B) reasonably can be added. If you are unsure whether this applies, use </helpthread:1028674284870180883> to change back to a normal help thread.

dense canopy
#

i can work on this

rugged mural
#

oh uh

#

bread

#

have you gotten started on this or no

dense canopy
#

i have

rugged mural
#

oh ok

dense canopy
#

why 😨

rugged mural
#

lmao nothing dw about it

dense canopy
#

☹️

abstract tulip
#

But I already marked it as a feature thread, what?

subtle gardenBOT
#
Changed to Feature

Thread is now a Feature thread. This indicates a request for a new feature to the plugin, that both (A) does not already exist and (B) reasonably can be added. If you are unsure whether this applies, use </helpthread:1028674284870180883> to change back to a normal help thread.

abstract tulip
#

Oh can you just keep doing it regardless?

#

Whack.

rugged mural
#

super feature thread it, ensure maximum featurey threadyness

abstract tulip
dense canopy
#

i actually have the PR ready to go. i forgot that my tick PR just got merged and i never opened this one. i'll do it now 👍

dense canopy
#

added! #changelog message

subtle gardenBOT
#
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.)

#

@abstract tulip

abstract tulip
#

Oh cool. Thank you, I'll mingle with this tomorrow and get back to you.

abstract tulip
#

This is working as intended.