Solved How To Make Clickable Blocks

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Yodexx

Member
Jun 13, 2020
19
0
1
Soooo... I'm trying to make a skript that will make it so that when you right click a specific block, with specific meta-data it will run a command. But the thing is I don't know how, and I've also been trying to look up how, but everything I find is just vanilla stuff that I can't even do.

My Example:
I'm trying to make a right clickable item that will trade in "souls" for something else. And I need to make a right clickable block to do so. (its an end portal frame btw)

Can any of you guys help me? I really want this done for my season 2 release of my server.
 
Soooo... I'm trying to make a skript that will make it so that when you right click a specific block, with specific meta-data it will run a command. But the thing is I don't know how, and I've also been trying to look up how, but everything I find is just vanilla stuff that I can't even do.

My Example:
I'm trying to make a right clickable item that will trade in "souls" for something else. And I need to make a right clickable block to do so. (its an end portal frame btw)

Can any of you guys help me? I really want this done for my season 2 release of my server.
maybe this?
Code:
on rightclick:
    if event-block is ...:
        #do stuff ... ?
 
That worked! Thank you, but now I don't know how to tell meta data of a specific block with that skript, which that's one thing I need.
 
Last edited:
This should suit your needs
Code:
on place of end portal frame:
    player's tool is named "&6Something":
    add location of event-block to {loc::*}

on rightclick on end portal frame:
    {loc::*} contains event-block's location:
    #do stuff
 
I keep getting errors:

This is my code:
Code:
on place of end portal frame:
 player's tool is named "&6Soul Well":
  add location of event-block to {clickableblocks::*}
on rightclick on end portal frame:
 {clickableblocks::*} contains event-block's location:
  # Stuff Here

And this is the error:
Code:
Line 2: Can't compare a slot with 'named "&6Soul Well"' (script.sk, line 2: player's tool is named "&6Soul Well":')
 
Code:
on place of end portal frame:
    name of tool of player is "&6Soul Well":
        add location of event-block to {clickableblocks::*}
on rightclick on end portal frame:
    {clickableblocks::*} contains event-block's location:
        # Stuff Here

its not that hard next time use tabs instead of 1 or 2 spaces
 
Status
Not open for further replies.