Minestom/src/main/java/fr/themode/demo/commands/SimpleCommand.java

27 lines
727 B
Java
Raw Normal View History

2020-04-05 10:15:21 +02:00
package fr.themode.demo.commands;
2020-04-24 03:25:58 +02:00
import net.minestom.server.command.CommandProcessor;
2020-04-25 23:06:16 +02:00
import net.minestom.server.entity.EntityCreature;
2020-04-24 03:25:58 +02:00
import net.minestom.server.entity.Player;
2020-04-25 23:06:16 +02:00
import net.minestom.server.instance.Instance;
2020-04-05 10:15:21 +02:00
public class SimpleCommand implements CommandProcessor {
@Override
public String getCommandName() {
return "test";
}
@Override
public boolean process(Player player, String command, String[] args) {
player.sendMessage("You tried the sample command!");
2020-04-09 14:25:42 +02:00
2020-04-25 23:06:16 +02:00
Instance instance = player.getInstance();
for (EntityCreature creature : instance.getCreatures()) {
creature.setPathTo(player.getPosition());
}
2020-04-05 10:15:21 +02:00
return true;
}
}