On right click on any block? And place heads

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

NewbyZ

Member
Jan 26, 2017
75
2
0
25
Hello,

How can I detect when to do rightclick on any block?

And how can I make it put a head of a player in the block the player has clicked?
Like this:

/setblock ~ ~1 ~ minecraft:skull 1 replace {Owner:{Id:"692c825a-163d-4cf9-aa3a-67c3454fbad4",Properties:{textures:[{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzU3YjhhY2QxNDViZDNkZmIxZGI5NGJkYmVkNDU4ZmUxODQ2YTljODg0ODIyY2EzY2U4MWE0Y2Y4MCJ9fX0="}]}},SkullType:3,Rot:0}

( http://minecraft-heads.com/custom/heads/humans/6386-skull )

Thanks!! :emoji_grinning:
 
code_language.skript:
on rightclick:
    if clicked block is not "<none>":
        set {_x} to clicked block's x-coord
        set {_y} to clicked block's y-coord
        set {_z} to clicked block's z-coord
        execute console command "/setblock {_x} {_y} {_z} minecraft:skull 1 replace {Owner:{Id:""692c825a-163d-4cf9-aa3a-67c3454fbad4"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzU3YjhhY2QxNDViZDNkZmIxZGI5NGJkYmVkNDU4ZmUxODQ2YTljODg0ODIyY2EzY2U4MWE0Y2Y4MCJ9fX0=""}]}},SkullType:3,Rot:0}"

The quotes inside the command must be doubled so that it knows you're inserting a quotation mark.
 
code_language.skript:
on rightclick:
    if clicked block is not "<none>":
        set {_x} to clicked block's x-coord
        set {_y} to clicked block's y-coord
        set {_z} to clicked block's z-coord
        execute console command "/setblock {_x} {_y} {_z} minecraft:skull 1 replace {Owner:{Id:""692c825a-163d-4cf9-aa3a-67c3454fbad4"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzU3YjhhY2QxNDViZDNkZmIxZGI5NGJkYmVkNDU4ZmUxODQ2YTljODg0ODIyY2EzY2U4MWE0Y2Y4MCJ9fX0=""}]}},SkullType:3,Rot:0}"

The quotes inside the command must be doubled so that it knows you're inserting a quotation mark.

Thanks, I'll test it tomorrow, out of curiosity, is there any way to put the custom head without "/setblock"? (using Skript effects)
 
code_language.skript:
on rightclick:
    if clicked block is not "<none>":
        set {_x} to clicked block's x-coord
        set {_y} to clicked block's y-coord
        set {_z} to clicked block's z-coord
        execute console command "/setblock {_x} {_y} {_z} minecraft:skull 1 replace {Owner:{Id:""692c825a-163d-4cf9-aa3a-67c3454fbad4"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzU3YjhhY2QxNDViZDNkZmIxZGI5NGJkYmVkNDU4ZmUxODQ2YTljODg0ODIyY2EzY2U4MWE0Y2Y4MCJ9fX0=""}]}},SkullType:3,Rot:0}"

The quotes inside the command must be doubled so that it knows you're inserting a quotation mark.
You can simply do
code_language.skript:
if clicked block is set:

because a variable can be set and be "<none>" (although unlikely)
 
Status
Not open for further replies.