1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Effect while holding item

Discussion in 'Skript' started by Ter2FIc, Jan 13, 2021.

Tags:
Thread Status:
Not open for further replies.
  1. Ter2FIc

    Ter2FIc Member

    Joined:
    Dec 30, 2020
    Messages:
    20
    Likes Received:
    0
    I was making an item that gives a speed effect while holding it.
    Code (Text):
    1. every 3 seconds:
    2.     if the player is holding iron sword named "&eSpeedster Sword":
    3.         apply speed 2 to player for 9999 days
    4.         wait 1 tick
    5.         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:
     
  2. Ter2FIc

    Ter2FIc Member

    Joined:
    Dec 30, 2020
    Messages:
    20
    Likes Received:
    0
    It doesn't work. It just gives speed II for 1 tick and the loop doesn't work.
     
  3. BadName

    BadName Member

    Joined:
    Oct 23, 2020
    Messages:
    23
    Likes Received:
    0
    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)
     
    #3 BadName, Jan 14, 2021
    Last edited: Jan 15, 2021
  4. WhiteWolf

    WhiteWolf Member

    Joined:
    May 2, 2020
    Messages:
    32
    Likes Received:
    2
    This works for me:
    Code (Text):
    1. every 3 real seconds:
    2.     loop all players:
    3.         if loop-player is holding a iron sword named "&eSpeedster Sword":
    4.             apply speed 2 to loop-player for 9999 seconds
    5.             wait 1 tick
    6.             remove speed from loop-player
     
  5. Ter2FIc

    Ter2FIc Member

    Joined:
    Dec 30, 2020
    Messages:
    20
    Likes Received:
    0
    I changed some codes and it works fine. Thks
     
Thread Status:
Not open for further replies.

Share This Page

Loading...