#(zemenus) Potion Effect Problems

62 messages · Page 1 of 1 (latest)

rain sail
#

I need to flag entity and set the expire to potion duration, I already added check in the if for the specific type of potion, but I can't set the duration tag correctly because I don't know how
- flag <context.entity> test expire:<context.entity.effects_data.get[duration]> doesn't work as I need and as I described above

timid violetBOT
#

(zemenus) Potion Effect Problems

timid violetBOT
#

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.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>

rain sail
#

Here is what effects_data returns

rapid crest
#

duration there is equal to -0.05s, or, one negative tick

#

you cant really have a negative expire duration on a flag i think

rain sail
#

Doesn't work as you can see

#

If I'll try to announce it - still doesn't work

odd pendant
#

because that tag returns a list of maps

#

not a map

#

.get[1].get[duration] would work

rain sail
#

lemme try that, I just didn't work with lists before (I think)

#

Ok, yup, it works, for now I set it to resolved I think

#

I'll come back later if I'll have some issues

hexed helmBOT
#
Resolved

Thread closed as resolved.

rain sail
#

Here I go again. I'm sorry but how do I get duration from list_effects? .get doesn't work with that and it returns this

hexed helmBOT
#
Thread Reopened

Thread was manually reopened by @rain sail.

rain sail
#

Oh, I just found out that it's depricated, ooops. Lemme test something real quick

tough bough
#

!t entitytag.effects_data

bronze sapphireBOT
rain sail
tough bough
#

The tag returns them in the map tag format from the

#

!m entitytag.potion_effects

bronze sapphireBOT
# tough bough !m entitytag.potion_effects

Set the entity's active potion effects.
Each item in the list must be a MapTag with keys:
"type" - from https://hub.spigotmc.org/javadocs/spigot/org/bukkit/potion/PotionEffectType.html
"amplifier" - number to increase the level by (0 for default level 1)
"duration" - DurationTag, how long it lasts
"ambient", "particles", "icon" - booleans

For example: [type=SPEED;amplifier=0;duration=120t;ambient=false;particles=true;icon=true]
This example would be a level 1 swiftness potion that lasts 120 ticks.

Object

EntityTag

Input

ListTag

Tags

<EntityTag.effects_data> Returns the active potion effects on the entity, in the MapTag format of the mechanism.
<EntityTag.list_effects> Deprecated in favor of !tag EntityTag.effects_data
<EntityTag.has_effect[<effect>]> Returns whether the entity has a specified effect. If no effect i...

rain sail
tough bough
#

!paste

bronze sapphireBOT
rain sail
#

Here, I need this context.new_effect return the duration, and I don't know how

#

I mean, .get doesn't work with that, so I need to parse probably?

#

Ok I'll wait for help cuz' I really don't know cry_angry

grave seal
#

using .get won't work because that context returns an ElementTag, not a ListTag. you could try and get the duration by using string manipulation, but that may be a bit tricky. i put my thoughts about whether or not this event should be updated here #denizen-contrib message

rain sail
#

Or I don't need to do it since #denizen-contrib message ?

grave seal
#

ehh you can make it one for now and if someone says it shouldn't be updated this can be changed back to a help thread

hexed helmBOT
#
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.

rain sail
# hexed helm

I wanted to describe the feature but basically read the #denizen-contrib message

rain sail
grave seal
#

#denizen-contrib message just going to put this here as it's a valid feature request

rain sail
grave seal
#

yeah you can make a new post for that. this can stay a feature thread

pure edge
#

can one of you please actually give a direct explanation within this thread of what feature is being requested?

odd pendant
#

!e potion effect modified

bronze sapphireBOT
#
Possible Confusion

Did you mean to search for entity potion effects modified?

bronze sapphireBOT
# odd pendant !e potion effect modified
Group

Entity

Event Lines

<entity> potion effects modified <entity> potion effects <change_action>

Switches

cause:<cause> to only process the event when it came from a specified cause.
effect:<effect type> to only process the event when a specified potion effect is applied.

Triggers

when an entity's potion effects change.

Has Player

when the entity that has changed is a player. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.

Has NPC

when the entity that has changed is an NPC.

Context

<context.entity> returns the EntityTag.
<context.cause> returns the cause of the effect change, based on <@link url https://hub.spigotmc.o...
<context.action> returns the action of the effect changed, which can be 'added', 'changed', 'cleared', or 'removed'
<context.override> returns whether the new potion effect will override the old.
<context.new_effect> returns the new potion effect (in the same format as <@link tag EntityTag.list_effects>) (if any).
<context.old_effect> returns the old potion effect (in the same format as <@link tag EntityTag.list_effects>) (if any).
<context.effect_type> returns the name of the modified potion effect type.

Determine

"OVERRIDE:<ElementTag(Boolean)>" to set whether the new potion effect should override.

Has Known Location

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

Cancellable

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

odd pendant
#

^ the new_effects context returns in an outdated format, the request is to update it to be a map as per

#

!t entitytag.effect_data

bronze sapphireBOT
#
Possible Confusion

Did you mean to search for entitytag.effects_data?

bronze sapphireBOT
woeful perch
#

Doing some cleanups around potion stuff either way, so I'll probably include this as well

pure edge
#

no you won't

woeful perch
#

As in you already did it or as in I'm missing something and it shouldn't be done?

pure edge
#

added as same context names but with _data ref #commit-log

hexed helmBOT
#
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.)

#

@rain sail