#(DeadPho3niX) Issue with duration recognition in item script

30 messages · Page 1 of 1 (latest)

grizzled iron
#

Hey, I wanted to create a custom item just now. It should be a drinkable potion that gives the player 10 seconds of invisibility. However, I noticed that when I give the item script the list of effects, the duration is only recognized on the second entry. So no matter which effect is in position one, it receives the default length. Is this a bug or am I doing something wrong? Ie this would give me a potion with invisibility 3minutes (default) and speed 10s:
<list[[type=invisibility;duration=10s]|[type=speed;duration=10s]]>

Here is my item script:

https://paste.denizenscript.com/View/110284

gentle meadowBOT
#

(DeadPho3niX) Issue with duration recognition in item script

gentle meadowBOT
#

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>

slow pecan
#

wait lemme just

#

@deep galleon <list[[type=invisibility;duration=10s]|[type=speed;duration=10s]]>

deep galleonBOT
slow pecan
#

@deep galleon <list[<map[type=invisibility;duration=10s]>|<map[type=speed;duration=10s]>]>

deep galleonBOT
slow pecan
#

fuck man, i actually dont recall how to do multiple potion effects w custom duration, i'll see if i can find this in my old files, meanwhile someone else could help you

grizzled iron
#

awesome, thanks 🙂

rose monolith
#

Perhaps we are overlooking something here.

#
"type" - from 🔗https://hub.spigotmc.org/javadocs/spigot/org/bukkit/potion/PotionType.html
"upgraded" - boolean, true means level 2 and false means level 1 (optional, default false)
"extended" - true means longer, false means shorter (optional, default false)
"color" - ColorTag (optional, default none)```
#

As such, duration is not a valid key for the first effect.

#

Perhaps you might get what you need by making a potion handler when a potion is consumed.

lilac apex
rose monolith
#

Because they are not potions; they are water bottles. I stupid'd. They are potions, however, the first potion effect is water, if I had to guess.

/give @p minecraft:potion{Potion:"minecraft:water",CustomPotionEffects:[{Id:1,Duration:200},{Id:2,Duration:200}],display:{Name:"\"Custom Potion\""}}
#

They have a filler first effect, then add the desired effects.

slow pecan
#

nope, i remember being able to do multiple effect potions with varied durations, not denizen limitation nor weird minecraft fuckery, this is just something stupidly simple we're overlooking

shy dune
#

potion_effects: - <map[type=INVISIBILITY;amplifier=0;duration=99999999;ambient=false;particles=false;icon=false]> - <map[whatever]

#

I just copied this from a random script of mine, not sure if it works this way, haven't tested, but it's worth a try at least

lilac apex
lilac apex
grizzled iron
#

thanks guys, you helped me a lot 🙂