Solved Place block skript

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

Hackusater

Active Member
Aug 5, 2017
74
2
8
34
I am trying to make it so it places the block next to it/on top of it instead of replacing the clicked block.
(Basically I am trying to make it so the stick is like a wood block that is being placed:
code_language.skript:
on rightclick with stick:
    set block at event-location to oak wood plank
 
I think this might help you:
code_language.skript:
set block at [block [number] [above|under|north|south|east|west]] %location% to %block%
Eg:
code_language.skript:
on rightclick with stick:
    set block at block 1 north event-location to oak wood plank
    set block at block 1 south event-location to oak wood plank
    set block at block 1 east event-location to oak wood plank
    set block at block 1 west event-location to oak wood plank
 
Last edited:
I think this might help you:
code_language.skript:
set block at [[number] block [above|under|north|south|east|west]] %location% to %block%
Eg:
code_language.skript:
on rightclick with stick:
    set block at block 1 north event-location to oak wood plank
    set block at block 1 south event-location to oak wood plank
    set block at block 1 east event-location to oak wood plank
    set block at block 1 west event-location to oak wood plank
If I am going to use your code I am going to need to be able to detect what side of the block I am clicking. (That is my question, how do I detect what side of the block I am clicking)
 
With this code you will make a fence structure around the player, I created this code some days ago, may this will help you

code_language.skript:
set block 3 north of the player to fence
set block 3 north 1 west of the player to fence
set block 3 north 2 west of the player to fence
set block 3 north 1 east of the player to fence
set block 3 north 2 east of the player to fence
set block 3 northeast of the player to fence
set block 3 east of the player to fence
set block 3 east 1 north of the player to fence
set block 3 east 2 north of the player to fence
set block 3 east 1 south of the player to fence
set block 3 east 2 south of the player to fence
set block 3 southeast of the player to fence
set block 3 south of the player to fence
set block 3 south 1 west of the player to fence
set block 3 south 2 west of the player to fence
set block 3 south 1 east of the player to fence
set block 3 south 2 east of the player to fence
set block 3 southwest of the player to fence
set block 3 west of the player to fence
set block 3 west 1 north of the player to fence
set block 3 west 2 north of the player to fence
set block 3 west 1 south of the player to fence
set block 3 west 2 south of the player to fence
set block 3 northwest of the player to fence
 
He wants to place a block adjacent to the clicked block face. For example if the north face is clicked then a block is placed 1 block north of the clicked block.

But I’m pretty sure it’s not possible to get the clicked block face. There might be some convuluted way to do what you want but it’s probably not worth the effort... just use an actual block
 
He wants to place a block adjacent to the clicked block face. For example if the north face is clicked then a block is placed 1 block north of the clicked block.

But I’m pretty sure it’s not possible to get the clicked block face. There might be some convuluted way to do what you want but it’s probably not worth the effort... just use an actual block
Attempting to use normal blocks interferes with worldguard.
 
The amount of people in this thread who don't get what you're asking is nuts.

Like @Snow-Pyon said, vanilla Skript has support for an 'event-direction' expression in block click events which gets the direction towards which they clicked the block (so if they clicked the north face, event-direction is north). This was added in dev26, so if you're on an older version then there's no way to do this without skript-mirror AFAIK.
 
Oh whoops I didn't fully read it. Thanks!
EDIT:
Can you give me a block click event example? Something like "On block click:" is what I need.
Well, if you're just clicking it then I'd use the right click event and then check if clicked block is set, but if you want detect when a player is breaking a block, use the block damage event. You can look up those in the documentation.
 
Well, if you're just clicking it then I'd use the right click event and then check if clicked block is set, but if you want detect when a player is breaking a block, use the block damage event. You can look up those in the documentation.
This is what I got from what you said.
code_language.skript:
on rightclick:
    if clicked block is set:
        send "%event-direction%" to player
But like I said before. There is no event direction on an on click event and I can't figure out what event it is on.
 
Status
Not open for further replies.