Interface UtilsWrapper


@Info("A collection of utilities") public interface UtilsWrapper
  • Method Details

    • getRandom

      @Info("Get a Random, for generating random numbers. Note this will always return the same Random instance") static net.minecraft.util.RandomSource getRandom()
    • newRandom

      @Info("Get a new random with the specified seed") static net.minecraft.util.RandomSource newRandom(long seed)
    • emptyList

      @Info("Get an immutable empty list") static <T> List<T> emptyList()
    • emptyMap

      @Info("Get an immutable empty map") static <K, V> Map<K,V> emptyMap()
    • newList

      @Info("Returns a new mutable list") static List<?> newList()
    • newMap

      @Info("Returns a new mutable map") static Map<?,?> newMap()
    • newCountingMap

      @Info("Returns a new counting map") static CountingMap newCountingMap()
    • regex

      @Info("Returns a regex pattern of the input") static Pattern regex(Object s)
    • regex

      @Info("Returns a regex pattern of the input with the specified flags") static Pattern regex(String pattern, int flags)
    • getStat

      @Info("Returns a Stat of the passed in ResourceLocation.\nNote that this requires the same ResourceLocation to get the same stat, so should not be used unless you want to make your own stat, and are storing an actual ResourceLocation somewhere to access it.\n") static net.minecraft.stats.Stat<net.minecraft.resources.ResourceLocation> getStat(net.minecraft.resources.ResourceLocation id)
    • getSound

      @Nullable @Info("Gets a SoundEvent from the id") static @Nullable net.minecraft.sounds.SoundEvent getSound(net.minecraft.resources.ResourceLocation id)
    • randomOf

      @Info("Gets a random object from the list using the passed in random") static Object randomOf(Random random, Collection<Object> objects)
    • randomOf

      @Info("Gets a random object from the list using the passed in random source") static Object randomOf(net.minecraft.util.RandomSource random, Collection<Object> objects)
    • randomOf

      @HideFromJS static Object randomOf(Collection<Object> objects, IntFunction<Integer> nextInt)
    • getSystemTime

      @Info("Gets the current system time, in milliseconds") static long getSystemTime()
    • isWrapped

      @Info("Checks if the passed in object is an instance of WrappedJS") static boolean isWrapped(@Nullable @Nullable Object o)
    • lazy

      @Info("Returns a lazy value with the supplier function as its value factory") static <T> Lazy<T> lazy(Supplier<T> supplier)
    • expiringLazy

      @Info("Returns a lazy value with the supplier function as its value factory, that will expire after the specified time") static <T> Lazy<T> expiringLazy(Supplier<T> supplier, Duration expires)
    • findCreativeTab

      @Nullable @Info("Returns the creative tab associated with the id") static @Nullable net.minecraft.world.item.CreativeModeTab findCreativeTab(net.minecraft.resources.ResourceLocation id)
    • runAsync

      @Info("Runs the provided runnable function in KubeJS\' background thread and returns its CompletableFuture") static CompletableFuture<Void> runAsync(Runnable task)
    • supplyAsync

      @Info("Runs the provided supplier function in KubeJS\' background thread and returns its CompletableFuture") static CompletableFuture<Object> supplyAsync(Supplier<Object> task)