Solved Click on block event?

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

cheatchki

Supporter ++
Jun 26, 2017
49
1
8
24
I would like to be able to get an event which when a player lets say right clicks on a fence post then it performs an action

Preferably I would like two examples

1. The block has a special value like let's say you place an enchantment table named research table, when clicked it would run code however normal enchantment tables wouldn't run this code

2. The block lets say it's a bookshelf can be naturally generated or player generated, and when clicked would run some code
 
placed items would not have a name, they loose that upon placing. You could add the event-block's location to a list variable when it is placed and then check if the event-location is apart of that list in the click event to execute the code.
For the bookshelf that's just plain old click event and checking what the event-block is.

For help with current code edit your post with this format here.
Else wise you can also post in the Requests section here.
 
You have 2 options to make it a "special" block.

1. Set the block as a list variable.
2. Add another block under the special block such as a sign as a replacement for variables.
 
So I decided to do a multiblock instead of an individual block for my machines, and it works. HOWEVER I am searching through every block around the main block in a radius of one, this of course waste very little ram, but nonetheless it still waste ram, would I be able to search for a specific block relative to it. so like ONLY look for the block below it, and not the other 6 blocks it scans through. Preferably I would like a relative searcg such as default MC example when looking for relative coords, ~x ~y ~z
 
Yeah, but I believe it requires more lines. Something like this:
code_language.skript:
set {_loc} to location 2 blocks below event-block
set {_loc} to location 2 blocks west of {_loc}
Basically, you keep changing the location. I'm pretty sure there's a way with one line but I'm not exactly sure.
 
Status
Not open for further replies.