Cancel event in specific world

Discussion in 'Skript' started by Cursinal, Feb 1, 2020.

  1. Ok so I made a skript for my minecraft server. I have multiverse core and I want to disable dropping items, picking them up and I want to disable damage in "world" and I don't want this skript to work in "survival". Can anyone help me with this skript becouse It's not working :/


    Code (Text):
    if player is in "world":
        on drop:
            cancel event
        on pickup:
            cancel event  
        on damage:
            cancel event
     
  2. try this :

    Code (Text):
    player's world = "world":
        on drop:
            cancel event
        on pickup:
            cancel event
        on damage:
            cancel event
     
    • Funny Funny x 1
  3. Still not working :/ It says "can't understand this event"
     
  4. what version you are using ?
     
  5. player world check is inside event not outside and for on damage you will need to use victim's world, not player's
     
  6. Skript v2.4.1
    Ok but still It can't understand event
     
  7. this should work:
    Code (Text):
    if player is in world "worldname":
        on drop:
            cancel event
        on pickup:
            cancel event
        on damage:
            cancel event
     
    • Funny Funny x 1
  8. Still nothing :/
     
  9. Code (Text):
    if %player's world% is "world":
        on drop:
            cancel event
        on pickup:
            cancel event
        on damage:
            cancel event
    dont change %player's world% only change the "world"
     
  10. upload_2020-2-1_17-46-35.png
     
  11. "if players world [...]" is not a trigger. you must use a valid skript event
     
  12. So should I add for eg. "on join:"
     
  13. Ok so I found a solution to my problem. I've added "player's gamemode is adventure" which works perfectly for me. Thanks to everyone who helped me.

    Code (Text):
    on drop:
        player's gamemode is adventure
        cancel event
       
    on pickup:
        player's gamemode is adventure
        cancel event
       
    on damage:
        victim's gamemode is adventure
        cancel event
     
  14. please don't help if you have absolutely no idea of how skript works, what you are saying is absolutely incorrect


    you can do the same with world...
    example:
    Code (Text):

    on drop:
        player's world is "test"
        cancel event
     
     
    • Winner Winner x 1
  15. It's actually quite easy, all you have to do is check for the players world then cancel the event
    Code (Text):
    world = "survival"

    on block place:
      if player's world is world:
        cancel event
     
     
  16. world = "survival" is invalid syntax, you can't create your own syntax like this without skript-mirror