public void Create(Position pos, Action <Entities> action)
        {
            Objective _age = FunctionWriter.EnsureAgeObjective();

            _age[EntitySelector.AllEntities.Is(type).Tag(tag)]++;
            Create(pos);
            _age[EntitySelector.AllEntities.Is(type).Tag(tag)]++;
            EntitySelector.AllEntities.Is(type).Score(_age, 1).Execute.Run(action);
        }
        public EntitySelector CreateAndGet(Position pos)
        {
            Objective _age = FunctionWriter.EnsureAgeObjective();

            _age[EntitySelector.AllEntities.Is(type).Tag(tag)]++;
            Create(pos);
            _age[EntitySelector.AllEntities.Is(type).Tag(tag)]++;
            return(EntitySelector.AllEntities.Is(type).Tag(tag).Score(_age, 1).LimitTo(1));
        }
 public void From(DataContainer container, string path)
 {
     FunctionWriter.Write($"data modify {modifier.container.ToDataCommand()} {modifier.path} {mode} from {container.ToDataCommand()} {path}");
 }
 public void Create(Position pos)
 {
     FunctionWriter.Write($"summon {type} {pos} {nbt.Copy().Set("Tags",new string[] {tag})}");
 }
 /// <summary>
 /// Creates functions to this namespace from the specified container.
 /// </summary>
 /// <param name="container"></param>
 public void AddFunctions(Type container)
 {
     FunctionWriter.GenerateFunctions(container.GetCustomAttribute <Root>() == null ? Utils.LowerCase(container.Name) + "/" : "", this, container);
 }
 public void Value(string value)
 {
     FunctionWriter.Write($"data modify {modifier.container.ToDataCommand()} {modifier.path} {mode} value {value}");
 }
Exemple #7
0
 public void RunRaw(string command)
 {
     FunctionWriter.Execute.Push(this);
     UseOnce = true;
     FunctionWriter.Write(command);
 }
Exemple #8
0
 public void Set(int value)
 {
     FunctionWriter.Write($"gamerule {this} {value}");
 }
 public static void AddSubFunctions(string path, Type subFolder)
 {
     FunctionWriter.CompileRecursive(subFolder, path + "/" + Utils.LowerCase(subFolder.Name) + "/");
 }
 public static IEnumerable <string> GetRawCommands(Action <Entities> execution)
 {
     FunctionWriter.GettingRawCommands = true;
     execution(This);
     return(FunctionWriter.GetRawCommands());
 }
Exemple #11
0
 public static Time operator +(Time t, int ticks)
 {
     FunctionWriter.Write("time add " + ticks);
     return(t);
 }