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.

Possible to allow user to place a sapling or plant o wood?

Discussion in 'Skript' started by retronix, Aug 18, 2018.

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

    Supporter +

    Joined:
    Aug 18, 2018
    Messages:
    19
    Likes Received:
    0
    So, in trying to figure out of it's possible to place a flower on wood using script.
     
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    225
    are you wanting to do this within your skript (like a command) or are you wanting to write so in game you can place a flower on wood?
     
  3. retronix

    Supporter +

    Joined:
    Aug 18, 2018
    Messages:
    19
    Likes Received:
    0
    So that ingame you can place it on wood
     
  4. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    225
    So after some testing.... this is an odd one. Skript doesn't recognize right clicking with a flower on a block it can't be placed on, such as wood.
    This is probably do-able in skript mirror... its not easy, but at least it recognizes the event

    EDIT: This IS do-able in Skript mirror
     
  5. retronix

    Supporter +

    Joined:
    Aug 18, 2018
    Messages:
    19
    Likes Received:
    0
    can you give me an example?
     
  6. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    225
    Even thought I sent this to you on discord, I wanted to post it here anyways... so if someone in the future sees it, they know what to do
    NOTE: Im just learning skript mirror so this may not be the cleanest way of doing this
    Code (Skript):
    1. on "org.bukkit.event.player.PlayerInteractEvent":
    2.     set {_p} to event.getPlayer()
    3.     if {_p}'s tool is a rose:
    4.         if "%event.getAction()%" is "RIGHT_CLICK_BLOCK":
    5.             send "YES" to {_p}
    6.             if event.getClickedBlock() is any oak log:
    7.                 set block above event.getClickedBlock() to rose
    8.                 remove 1 of {_p}'s tool from {_p}'s tool
    9.  
     
Thread Status:
Not open for further replies.

Share This Page

Loading...