#(podjazd) Hello how can i make visual cooldown on nbt item

171 messages · Page 1 of 1 (latest)

marble coral
#

Hello how can i make visual cooldown on nbt item

warped pathBOT
#

(podjazd) Hello how can i make visual cooldown on nbt item

warped pathBOT
#

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.

marble coral
#

someone know bc if i use a cooldown for a sword then another sword have cooldown also

worthy ibex
#

could use flags

marble coral
#

?

lusty badge
#

gotta wait for components

marble coral
#
        on player damages player with:mieczzatrucia:
        - flag <context.damager> mieczzatrucia_last_hit:<context.entity>
        - if <util.random_chance[10]>:
            - if !<player.has_flag[mieczcooldownzatrucia]>:
                - define countdown_time2 60
                - flag <player> mieczcooldownzatrucia expire:<[countdown_time2]>s
                - itemcooldown netherite_sword d:<[countdown_time2]>s
                - inject skill_mieczzatrucia
                - repeat <[countdown_time2]>:
                    - actionbar "<&color[#08FB71]><bold>MIECZ ZATRUCIA <dark_gray>» (<gray>Odnowi się za: <white><[countdown_time2]>s<dark_gray>)" targets:<player>
                    - define countdown_time2 <[countdown_time2].sub[1]>
                    - wait d:1s
                - actionbar "<&color[#08FB71]><bold>MIECZ ZATRUCIA <dark_gray>» (<gray>Odnowi się za: <white>TERAZ!<dark_gray>)" targets:<player>
#

for this

lusty badge
#

flag doesnt work

marble coral
#

you mean this ? - flag <context.damager> mieczzatrucia_last_hit:<context.entity>

#

its working

lusty badge
#

itemcooldown applies a cooldown to a material type not an item

#

so flagging an item wont help

marble coral
#

is it possible to make a visual cooldown for specific item

lusty badge
#

yes, with components

marble coral
#

can you help me with that?

lusty badge
#

no, components havent been implemented yet

#

they will be tho

#

they are new in 1.21.3 i think

marble coral
#

so if denizen go update

#

then compononts

#

will work?

lusty badge
#

yes but not guranteed to be next update

marble coral
#

so rn i can't make it

#

yes?

lusty badge
#

right

marble coral
#

uh

#

but if i have 1.20.4 and denizen go update

#

it work for me also or on 1.21.3

#

only

lusty badge
#

components only work 1.21.3 and above

worthy ibex
#

oh only visual?

marble coral
lusty badge
#

because - itemcooldownapplies a cooldown to a material type

worthy ibex
#

yea for visual you would need to wait

marble coral
lusty badge
#

are you talking ab wynncraft?

worthy ibex
#

but other than that you could just use flags yea

marble coral
lusty badge
#

custom server resource pack?

marble coral
#

yes

lusty badge
#

then use F3+H

#

and check the material of the items

#

they wont be the same

marble coral
#

components?

lusty badge
#

my bad the itemcooldown component has been added in 24w34a
so its 1.21.2+ not 1.21.3+

lusty badge
marble coral
#

okat you right

marble coral
lusty badge
#

that wont help with the visual cooldown problem

#

you fr gottawait for components to be added to denizen

#

like fr

marble coral
worthy ibex
#

or i mean you could do the same thing as they do

lusty badge
marble coral
worthy ibex
#

yea sure

#

!haste

snow compassBOT
worthy ibex
#

this please ^

marble coral
worthy ibex
#

hmmmm everything looks like, is it not working properly?

marble coral
#

you know what i mean?

#

bc rn if 2 cooldown active the actionbar are stacking

jagged onyx
#

you just have to do that manually

#

can just have a flag on the player that is a list of things their actionbar should show

#

wouldn't overload that, though

marble coral
# jagged onyx you just have to do that manually
                - repeat <[countdown_time]>:
                    - if <player.has_flag[mieczcooldownzatrucia]>:
                        - actionbar " " targets:<player>
                        - stop
                    - else:
                        - actionbar "<&color[#9F08FB]><bold>MIECZ ENDERMANA <dark_gray>» (<gray>Odnowi się za: <white><[countdown_time]>s<dark_gray>)" targets:<player>
                        - define countdown_time <[countdown_time].sub[1]>
                        - wait d:1s
#

i do like this

#

and when the <player.has_flag[mieczcooldownzatrucia]>

#

is active still the actionbar below working idk why

#

okay i fix that

#

but i have another problem

#

- actionbar "<&color[#9F08FB]><bold>MIECZ ENDERMANA <dark_gray>» (<gray>Odnowi się za: <white><[countdown_time2]>s<dark_gray>) | <&color[#08FB71]><bold>MIECZ ZATRUCIA <dark_gray>» (<gray>Odnowi się za: <white><[countdown_time2]>s<dark_gray>)"

#

how can i get the countdown value from the 1 event

hybrid drift
#

One event?

#

I see you're flagging the player.

#

You can pull the players flag expiration.

#

!t flaggableobject.flag_expiration

snow compassBOT
hybrid drift
#

I'd suggest...

#

!t timetag.from_now

snow compassBOT
# hybrid drift !t timetag.from_now

Returns the DurationTag between this time object and the real current system time.
The value will always be positive.
This is equivalent to the absolute value of ".duration_since[<util.time_now>]", and exists primarily as a convenience tag.
For example, a TimeTag for Tuesday will return a DurationTag of '1d' when the tag is used on a Monday.
A TimeTag for Sunday will also return a DurationTag of '1d' when used on a Monday.
If positive/negative differences are required, consider instead using !tag TimeTag.duration_since.

Returns

DurationTag

hybrid drift
#

And then

#

!t durationtag.formatted

snow compassBOT
# hybrid drift !t durationtag.formatted

Returns the value of the duration in an easily readable format like 2h 30m,
where minutes are only shown if there is less than a day left and seconds are only shown if there are less than 10 minutes left.
Will show seconds, minutes, hours, days, and/or years.

Returns

ElementTag

next shaleBOT
hybrid drift
#

Or.

next shaleBOT
harsh lodge
# hybrid drift Or.

That’s not what he meant. What he means is that when he uses the 'enderman sword,' it shows 58s on the action bar, for example, and then when he uses the 'poison sword,' the action bar shows: 'ENDERMAN SWORD: 60s | POISON SWORD 60s,' but he can use the enderman sword earlier. I’m not sure if you understood me.

hybrid drift
#

Is that correct?

harsh lodge
#

the thing is that if I use the enderman sword and after 20 seconds I use the poison sword, the action bar will show that the enderman sword will cool down in 40 seconds and the poison power will cool down in 60 seconds

hybrid drift
#

Define the element before narrating. Check if the player has both flags?

- define S "Countdown: 10"
- if <player.has_flag[test_countdown]>:
  - define S "Countdown: 10 | Alt Countdown: 20"
#

Etc.

marble coral
#

dont uderstand

glacial pastureBOT
hybrid drift
#

You want the message to change depending on the cooldowns right?

marble coral
#

in this event

hybrid drift
#

Don't upload scripts.

#

!haste

snow compassBOT
marble coral
#

in this event area

#

are

#

two on player damages player with:mieczzatrucia:

#

and the issue is

#

if player use a specialitem

#

then he gets cooldown and the visual cooldown on the action bar like <specialtiem> cooldown: <value>

#

and if i use the second special item then

hybrid drift
#

You're doing a repeat based on the countdown time huh?

#

Hmmm.

marble coral
#

yes

hybrid drift
#

I don't think you wanna do the action bar here.

#

I think you wanna do it..

#

!e delta time

snow compassBOT
# hybrid drift !e delta time
Group

Core

Event Lines

delta time hourly|minutely|secondly

Switches

every:<count> to only run the event every *count* times (like "on delta time secondly every:5" for every 5 seconds).

Triggers

every <count> seconds, minutes, or hours of game calculation time. Default repetitions count of 1.
This is specifically based on the rate of time advancement in the game server,
which is not necessarily equivalent to the real passage of time (for example, this event may fire slower if the server is lagging).
For real time, see !event system time.

Context

<context.second> returns the exact delta time since system start.

hybrid drift
#

Delta time, loop through all players.

#

Check if they have either flag.

marble coral
#

but i want to do

#

if second item will activate

#

then

#

the first actionbar stop

#

and make one action bar but it will be show 2 cooldown

#

you know what i mean?

hybrid drift
#

Yes. As said, do a delta time event to check for flags to change the message.
You can action bar once to show it updated in your swing, and then let the delta time do it's thing.

#

Although some may suggest a task is a better idea as long as the player is online, but a delta time may be better right now.

marble coral
#

idk how can i do that i started in denizen yesterday

hybrid drift
#

Weirdly there is no example usage for delta time event.

#

I pulled up the meta for it though.

marble coral
#

so i must to change the repeat to delta ?

hybrid drift
#
on delta time secondly:
  - narrate "Running every second"

You can do something every second that passes with a delta time event.

#

!t server.online_players

snow compassBOT
hybrid drift
#

You can loop through all players.

#

!c foreach

snow compassBOT
# hybrid drift !c foreach
Group

queue

Syntax

foreach [stop/next/<object>|...] (as:<name>) (key:<name>) [<commands>]

Short Description

Loops through a ListTag, running a set of commands for each item.

Description

Loops through a ListTag of any type. For each item in the ListTag, the specified commands will be ran for that list entry.

Alternately, specify a map tag to loop over the set of key/value pairs in the map, where the key will be <[key]> and the value will be <[value]>.
Specify "key:<name>" to set the key definition name (if unset, will be "key").

Specify "as:<name>" to set the value definition name (if unset, will be "value").
Use "as:__player" to change the queue's player link, or "as:__npc" t...

marble coral
#

e okay

#

i will try e

#

xD

hybrid drift
#

Maybe someone else has a better method?

marble coral
#

Bc right now if player use the first SpecialSword then he get cooldown 60 seconds and 60 seconds countdown on the actionbar and if then i will use the second SpecialSword then the sword gets cooldown 60s also the first SpecialSword actionbar go stop and creates a new Actionbar like "<specialword1> >> <value1> | <specialsword2> <value2>" but th issue is that i can't get the value of the cooldown from the first specialsword idk why if i try <[countdown_time2]> then plugin say that its not define and i want to only get the value of the second or first value(event)

#

and i can do that in this what you send me?

hybrid drift
#

You can pull the flags as long as you loop through the players.

#

The foreach meta page shows you how to loop through every online player and do things with them.

marble coral
#

the loop is working but i can't use the value

#

the define to put it on the second actionbar

hybrid drift
#

Because it's not defined in that event.

#

You have to define it yourself.

#

Defines are localized to the event or script that you're working in.

#

(Script being task, procedure, etc.)

marble coral
#

okay

#

someone know is it possible in fakeequip that if player get the fakeequip armor effect will changes also?

hybrid drift
#

Effects?

#

You mean like if the item has changes to the player like speed and health?

marble coral
#

i mean bc default when player get the fakeequip

#

then still he gets the armor from the another amor equipment

#

and i dont want this

hybrid drift
#

Fake equipping seems like just a visual thing, but I'm not fluent enough to know if this is the case.

#

But judging from the name of fakeequip I'd like to say that the armor is still on the player, but visually it's changed.

marble coral
#

yes thats why im asking is it possible to do smth like this but the armor will effects be changed

lusty badge
#

vague