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 On Block Place

Discussion in 'Skript' started by Daisy, Sep 17, 2020.

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

    Daisy Member

    Joined:
    Sep 16, 2020
    Messages:
    3
    Likes Received:
    0
    Hey guys! I'm a relatively new skripter, and I'm not sure on how to "discriminate" which blocks get placed.
    (I'm trying to make a generator plugin, and I've gotten everything else worked out) I've tried adding an NBT tag and even trying to change MetaData; (to no avail) Heres the code I've been using:

    Code (Text):
    1. on place of furnace:
    2.      if event-block has custom nbt tag "gen": #I've also tried normal just "nbt tag "gen""
    3.             #code
    4.      else:
    5.             #extra code
    6.      
    I've tried even using metadata, but nothin seems to work.
    I have SkBee installed, and I can't assign a nbt tag to items (I'll work that out)
    (I've checked the docs)
     
    #1 Daisy, Sep 17, 2020
    Last edited: Sep 20, 2020
  2. Best Answer:
    Post #2 by neolia, Sep 19, 2020
  3. neolia

    neolia New Member

    Joined:
    Sep 19, 2020
    Messages:
    5
    Likes Received:
    0
    if i understood it correctly you could just do something like
    Code (Text):
    1. options:
    2.     Nameofitem:&7&l(&6Generator&7&l)  #the name of the generator while in item form
    3.  
    4.  
    5.  
    6.  
    7. command /getgen: #to get the gen
    8.     trigger:
    9.         give 1 furnace named "@{Nameofitem}" to player
    10.  
    11.  
    12.  
    13.  
    14.  
    15. on place of furnace:
    16.     if player's tool is a furnace named "@{Nameofitem}":
    17.         #Code it's a gen
    18.  
    19.     else:
    20.         #Code its not a Gen
     
  4. Daisy

    Daisy Member

    Joined:
    Sep 16, 2020
    Messages:
    3
    Likes Received:
    0
    YES! Thank you so much! This works really well. (I didn't realize I could do the "if player's tool" thing to items like that!)
    This works amazing!
     
Thread Status:
Not open for further replies.

Share This Page

Loading...