@Info("Get a Random, for generating random numbers. Note this will always return the same Random instance")
staticnet.minecraft.util.RandomSourcegetRandom()
newRandom
@Info("Get a new random with the specified seed")
staticnet.minecraft.util.RandomSourcenewRandom(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")
staticList<?>newList()
newMap
@Info("Returns a new mutable map")
staticMap<?,?>newMap()
newCountingMap
@Info("Returns a new counting map")
staticCountingMapnewCountingMap()
regex
@Info("Returns a regex pattern of the input")
staticPatternregex(Object s)
regex
@Info("Returns a regex pattern of the input with the specified flags")
staticPatternregex(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")
staticnet.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.SoundEventgetSound(net.minecraft.resources.ResourceLocation id)
randomOf
@Info("Gets a random object from the list using the passed in random")
staticObjectrandomOf(Random random,
Collection<Object> objects)
randomOf
@Info("Gets a random object from the list using the passed in random source")
staticObjectrandomOf(net.minecraft.util.RandomSource random,
Collection<Object> objects)
@Info("Gets the current system time, in milliseconds")
staticlonggetSystemTime()
isWrapped
@Info("Checks if the passed in object is an instance of WrappedJS")
staticbooleanisWrapped(@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.CreativeModeTabfindCreativeTab(net.minecraft.resources.ResourceLocation id)
runAsync
@Info("Runs the provided runnable function in KubeJS\' background thread and returns its CompletableFuture")
staticCompletableFuture<Void>runAsync(Runnable task)
supplyAsync
@Info("Runs the provided supplier function in KubeJS\' background thread and returns its CompletableFuture")
staticCompletableFuture<Object>supplyAsync(Supplier<Object> task)