Effect while holding item

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Ter2FIc

Member
Dec 30, 2020
20
0
1
25
I was making an item that gives a speed effect while holding it.
Code:
every 3 seconds:
    if the player is holding iron sword named "&eSpeedster Sword":
        apply speed 2 to player for 9999 days
        wait 1 tick
        remove speed from player
Console says: There's no world in a periodic event if no world is given in the event (e.g. like 'every hour in "world"') (item.sk, line 2: if the player is holding iron sword named "&eSpeedster Sword":')

I don't really see any problems with it :emoji_frowning:
 
It doesn't work. It just gives speed II for 1 tick and the loop doesn't work.
 
I was making an item that gives a speed effect while holding it.
Code:
every 3 seconds:
    if the player is holding iron sword named "&eSpeedster Sword":
        apply speed 2 to player for 9999 days
        wait 1 tick
        remove speed from player
Console says: There's no world in a periodic event if no world is given in the event (e.g. like 'every hour in "world"') (item.sk, line 2: if the player is holding iron sword named "&eSpeedster Sword":')

I don't really see any problems with it :emoji_frowning:

this command gives you an unbreakable iron sword and when you hold it your speed is set to 1.2 if it was normally 1

/give @s minecraft:iron_sword{Unbreakable:1,AttributeModifiers:[{AttributeName:"generic.movement_speed",Name:"generic.movement_speed",Amount:0.2,Operation:1,UUID:[I;1045876203,1066204591,1045905617,1579378094]}]} 1

(1.16)
 
Last edited:
It doesn't work. It just gives speed II for 1 tick and the loop doesn't work.
This works for me:
Code:
every 3 real seconds:
    loop all players:
        if loop-player is holding a iron sword named "&eSpeedster Sword":
            apply speed 2 to loop-player for 9999 seconds
            wait 1 tick
            remove speed from loop-player
 
Status
Not open for further replies.