-1

So I'm trying to make something and I want a /tellraw to activate and when the player clicks on it multiple things happen. What I mean is when they click on the text like 5 /setblock commands activate. I can't figure out how do do this. I have tried just putting multiple clickEvents in but it does not work. Is this even possible? I'm still on 1.7.10 so please don't give me 1.8 or above answers.

0

Well, seeing as you are on 1.7.10 I would say the easiest way is to make the /tellraw command activate a /setblock command that puts a redstone block in an area that activates the five command blocks. Yes, it's that simple. I used to use this when I was trying to make a map back in 1.7.10 all the time! This is the easiest way to do it in 1.7.10 from what I know. I hope this helps!

  • sorry. i wasn't very clear when i made my question. what i meant is when the person clicks on the /tellraw thing it activates 5 setblock commands relative to the players cordinates. – gamer103 Apr 3 '16 at 19:48
  • Can you please show the command you are using in the question? – GoldNugget8 Apr 4 '16 at 14:31
0

Are you the owner of the server, does it run bukkit and do you know how to write Java? If all of the above are yes, I think it would be easiest to create a small plugin that achieves this. If you don't, the best is to look at the other answers.

It is very easy to create a command listener that dispatches more commands when it activates. You can then use a /tellraw to call this command. Here is some example code:

package my.pkg;

import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.java.JavaPlugin;

public class MyPlugin extends JavaPlugin {

    @Override
    public boolean onCommand(CommandSender sender, Command command, String alias, String[] args) {
        if (command.getName().equalsIgnoreCase("mycommand")) {
            Bukkit.dispatchCommand(sender, "command1");
            Bukkit.dispatchCommand(sender, "command2 with arguments");
            Bukkit.dispatchCommand(sender, "command3");
        }
    }
}

What this code does is listen for /mycommand. If someone does this command (by clicking a link from a /tellraw message for example), the code will automatically fire the commands /command1, /command2 with arguments and /command3. These commands can be any command, like the /setblock you mentioned.

For more information on creating plugins, here is a (slightly older, but still viable) video:

.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.