use of org.terasology.engine.logic.chat.ChatMessageEvent in project Terasology by MovingBlocks.
the class WorldCommands method simulate.
@Command(shortDescription = "Random", runOnServer = true)
public String simulate(@Sender EntityRef sender) {
EntityRef simulatedEntity = entityManager.create("engine:multiWorldSim");
DisplayNameComponent displayNameComponent = simulatedEntity.getComponent(DisplayNameComponent.class);
displayNameComponent.name = "I-Travel-Worlds-" + simulatedEntity.getId();
simulatedEntity.saveComponent(displayNameComponent);
ColorComponent colorComponent = simulatedEntity.getComponent(ColorComponent.class);
colorComponent.color = Color.RED;
simulatedEntity.saveComponent(colorComponent);
sender.send(new ChatMessageEvent("yay", simulatedEntity));
return "done";
}
Aggregations