#(zemenus) Potion Effect Problems
62 messages · Page 1 of 1 (latest)
(zemenus) Potion Effect Problems
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>
Here is what effects_data returns
duration there is equal to -0.05s, or, one negative tick
you cant really have a negative expire duration on a flag i think
even if so, when I apply 3 minutes inisibility to zombie for example: https://paste.denizenscript.com/View/113146
Content of Server Log Paste #113146: Denizen Debug Logs From A Minecraft Server... pasted 2023/07/31 11:12:12 UTC-07:00, Paste length: 4575 characters across 45 lines, Content: Java Version: 17.0.7Up-time: 1h 26m
Doesn't work as you can see
If I'll try to announce it - still doesn't work
because that tag returns a list of maps
not a map
.get[1].get[duration] would work
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
Thread closed as resolved.
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
Thread was manually reopened by @rain sail.
Oh, I just found out that it's depricated, ooops. Lemme test something real quick
!t entitytag.effects_data
Returns the active potion effects on the entity, in the MapTag format of the mechanism.
attribute
ListTag(MapTag)
EntityTag.potion_effects
ok, how to get duration from the new_effect, it returns same values
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.
EntityTag
ListTag
<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...
I'm trying to use the .get with the new_effect, and it doesn't work, here what new_effect returns:
!paste
Help us help you by pasting your script to https://paste.denizenscript.com/New/Script and linking it back here.
Content of Denizen Script Paste #113149: Unnamed Denizen Script Paste... pasted 2023/07/31 12:08:03 UTC-07:00, Paste length: 154 characters across 5 lines, Content: test: type: world
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 
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
Oh damn, that's kinda bad. Can I change it to the feature thread and ask for the feature itself?
Or I don't need to do it since #denizen-contrib message ?
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
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.
I wanted to describe the feature but basically read the #denizen-contrib message
So... I never worked with ElemenTag that way, how do I get the duration tag from there and, well, parse it to make it duration, now elementtag
#denizen-contrib message just going to put this here as it's a valid feature request
So I need to create new thread for helping?
yeah you can make a new post for that. this can stay a feature thread
can one of you please actually give a direct explanation within this thread of what feature is being requested?
!e potion effect modified
Did you mean to search for entity potion effects modified?
Entity
<entity> potion effects modified <entity> potion effects <change_action>
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.
when an entity's potion effects change.
when the entity that has changed is a player. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.
when the entity that has changed is an NPC.
<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.
"OVERRIDE:<ElementTag(Boolean)>" to set whether the new potion effect should override.
True - this adds switches in:<area> + location_flagged:<flag name>.
True - this adds <context.cancelled> and determines cancelled + cancelled:false.
^ 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
Did you mean to search for entitytag.effects_data?
Returns the active potion effects on the entity, in the MapTag format of the mechanism.
attribute
ListTag(MapTag)
EntityTag.potion_effects
Doing some cleanups around potion stuff either way, so I'll probably include this as well
no you won't
As in you already did it or as in I'm missing something and it shouldn't be done?
added as same context names but with _data ref #commit-log
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