I've been trying to make a skript that would be good for gen servers (repeatedly places a block in the same place so you can mine it forever), however there seem to be almost no resources on how to change a command block's command. I'm also completely new to skript, and just trying to figure things out. Here's how far I've got:
If there is a better way of doing this, (i.e without command blocks) that would be good to know aswell.
code_language.skript:
command /genstick:
permission: op
permission message: &r&fUnkown command. Type "/help" for help.
trigger:
set {_genstick} to unbreakable blaze rod named "&6Gen Stick"
give player {_genstick}
on rightclick with blaze rod:
if name of player's tool is "&6Gen Stick":
if player is an operator:
set {_clicked} to event-block
set {_x} to x-coord of {_clicked}
set {_y} to y-coord of {_clicked}
set {_z} to z-coord of {_clicked}
set block 2 below {_clicked} to repeating command block
make console execute command data merge "blockdata %{_x}% %{_y}% %{_z}% {auto:1b,Command:\"setblock ~ ~10 ~ %type of {_clicked}%\"}"
If there is a better way of doing this, (i.e without command blocks) that would be good to know aswell.