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.

Solved Help With Click on air

Discussion in 'Skript' started by Dynamic___, Jul 8, 2018.

Thread Status:
Not open for further replies.
  1. Dynamic___

    Dynamic___ Member

    Joined:
    Jun 17, 2018
    Messages:
    2
    Likes Received:
    0
    Hello, I'm currently trying to log every creeper egg placed by a player. I tried two approach to this but both don't seem to work.

    My first attempt is here:

    Code (Skript):
    1. on place a spawner_egg:50:
    2.     log "%player% placed CreeperEgg in %world% at %location of block%" to "creeper/creeperplacement.yml"
    3.     message "Test"
    This doesn't bring up any error but it doesn't log the placement since a creeper egg isn't a block

    My second attempted was to do a click event:

    Code (Skript):
    1. on click:
    2.     if event-block is not air:
    3.         if held item is a spawner_egg:50:
    4.             log "%player% placed CreeperEgg in %world% at %location of block%" to "creeper/creeperplacement.yml"
    5.             message "hi"
    In this case "if event-block is not air" doesn't seem to work, it still logs if the player clicks on air.
    Thanks in advance
     
  2. jackass

    jackass Member

    Joined:
    Nov 8, 2017
    Messages:
    16
    Likes Received:
    0
    Replace

    on click:

    with either

    on click of block:

    on click of a block:
     
  3. fly

    fly New Member

    Joined:
    May 11, 2017
    Messages:
    9
    Likes Received:
    0
    Forget about this, sorry for the confusion
     
    #3 fly, Jul 9, 2018
    Last edited: Jul 27, 2018
  4. Dynamic___

    Dynamic___ Member

    Joined:
    Jun 17, 2018
    Messages:
    2
    Likes Received:
    0
    Sorry don't understand, could you elaborate?
     
  5. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,501
    Likes Received:
    107
    Medals:
    I don't really think the file extension matters here, because it just adds a line whatever the extension may be.
     
  6. PatoFrango

    PatoFrango Active Member

    Joined:
    Jul 12, 2017
    Messages:
    240
    Likes Received:
    14
    Try using "on rightclick" instead of "on click"
     
  7. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,501
    Likes Received:
    107
    Medals:
    Try using if clicked block is set instead of if event-block is not air
     
  8. fly

    fly New Member

    Joined:
    May 11, 2017
    Messages:
    9
    Likes Received:
    0
    Nope I tried with skutitlites and it rewrites the whole file every time you add a line.
    I confirmed this fact by looking at the source code.
     
  9. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,501
    Likes Received:
    107
    Medals:
    Yeah, but does it only do that with .yml or with every file?
     
  10. fly

    fly New Member

    Joined:
    May 11, 2017
    Messages:
    9
    Likes Received:
    0
  11. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,501
    Likes Received:
    107
    Medals:
  12. fly

    fly New Member

    Joined:
    May 11, 2017
    Messages:
    9
    Likes Received:
    0
    Lol sorry my bad
    I made the comment a while back and forgot about the original post entirely...
     
    • Funny Funny x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...