Skip to content

API reference ​

Every public signature, generated from the Rimulib source for version 1.2.2. Read the guides for what each one does.

On Minecraft 26.3, UiApi methods take GuiGraphicsExtractor in place of GuiGraphics. On Minecraft 1.20.1 and 1.21.1, NetApi and NetClientApi use RimuPacket. Everything else is the same on all targets.

RimulibApi ​

cyou.rimuru.rimulib.api.RimulibApi

java
public final class RimulibApi {
  public static RimuMod connect(String modId, Class<?> anchor);
  public static RimuMod connect(String modId, Class<?> anchor, String minimum);
  public static String apiVersion();
  public static String version();
  public static String loader();
  public static boolean isLoaded(String modId);
  public static Collection<RimuMod> mods();
}

CarveApi ​

cyou.rimuru.rimulib.api.CarveApi

java
public final class CarveApi {
  public static final int UNTOUCHED = Carving.UNTOUCHED;
  public interface Floor {
    int at(int x, int z);
  }
  public interface Surface {
    BlockState at(int x, int y, int z, BlockState was);
  }
  public interface Joiner {
    BlockState join(BlockState state, BlockPos at, Function<BlockPos, BlockState> around);
  }
  public interface Watcher {
    void changed(ServerLevel level, int x, int y, int z, BlockState was);
  }
  public static Cut column(ServerLevel level, Vec3 centre, double radius);
  public static Cut column(ServerLevel level, Vec3 centre, double radius, BlockPos spared);
  public static Cut flatten(ServerLevel level, Vec3 centre, double radius, int y);
  public static Cut flatten(ServerLevel level, Vec3 centre, double radius, Floor floor, Surface surface);
  public static Cut flatten(ServerLevel level, Vec3 centre, double radius, Floor floor, Surface surface, BlockPos spared);
  public static Cut slit(ServerLevel level, Vec3 centre, double halfLength, DoubleUnaryOperator halfWidth);
  public static Cut wedge(ServerLevel level, Vec3 apex, Vec3 heading, double start, double length, double halfWidth, double spread);
  public static Cut line(ServerLevel level, Vec3 start, Vec3 heading, double length, double halfWidth, Floor floor, Surface surface);
  public static Cut lens(ServerLevel level, Vec3 centre, Vec3 heading, double halfLength, DoubleUnaryOperator halfWidth, Floor floor,
  public static void paint(ServerLevel level, Map<BlockPos, BlockState> blocks);
  public static void keepBlocks(Predicate<BlockState> blocks);
  public static void joinWith(Joiner joiner);
  public static void watch(Watcher watcher);
  public static void onTimeTurn(Consumer<ServerLevel> listener);
  public static void turnTime(ServerLevel level);
  public static final class Cut {
    public Cut named(String label);
    public Cut keepBlocks();
    public Cut perTick(int chunks);
    public Cut lazy();
    public Cut streaming(Consumer<ChunkPos> hold, Consumer<ChunkPos> release);
    public Cut start();
    public void tick();
    public void tick(double front);
    public boolean done();
    public void stop();
    public void finish();
    public List<ChunkPos> chunks();
  }
}

SkillApi ​

cyou.rimuru.rimulib.api.SkillApi

java
public final class SkillApi {
  public static <S extends Skill> SkillSet register(String modId, String name, int accent, S[] skills, SkillSet.Caster<S> caster);
  public static SkillSet registerHidden(String modId, String name, int accent, Skill[] skills);
  public static void whenRegistered(String modId, Consumer<SkillSet> listener);
  public static <S extends Skill> void extend(SkillSet set, S[] skills, SkillSet.Caster<S> caster);
  public static void gate(SkillSet set, SkillSet.Gate gate);
  public static SkillSet setOf(Skill skill);
  public static int index(Skill skill);
  public static Skill byIndex(String modId, int index);
  public static int count(String modId);
  public static List<SkillSet> sets(String modId);
  public static SkillHolder held(Player player);
  public static boolean holds(Player player, SkillSet set);
  public static void forceKill(String modId, boolean erases);
  public static boolean forceKill(String modId);
  public static float maxDamage(String modId);
  public static Tuning clamp(Tuning tuning, Skill skill, Tuning.Limits limits);
  public static void limit(Skill skill, Tuning.Limits limits);
  public static Tuning.Limits limits(Skill skill);
  public static void deny(ServerPlayer player, Component message);
  public static int cooldown(ServerPlayer player, Skill skill);
  public static void clearCooldowns(ServerPlayer player, String modId);
  public static boolean filmsForAll(ServerPlayer player, String modId);
  public static void shareCastState(String modId, CastState.Source source);
  public static Tuning tuning(Skill skill);
}

EraseApi ​

cyou.rimuru.rimulib.api.EraseApi

java
public final class EraseApi {
  public static ErasePolicy unmake(ResourceKey<DamageType> erase, ResourceKey<DamageType> hit);
  public static ErasePolicy kill(ResourceKey<DamageType> erase, ResourceKey<DamageType> hit);
  public static void hit(ErasePolicy policy, ServerLevel level, Entity victim, ServerPlayer attacker, float damage);
  public static void strike(ErasePolicy policy, ServerLevel level, Entity victim, ServerPlayer attacker);
  public static void letGo(Entity entity);
}

WardApi ​

cyou.rimuru.rimulib.api.WardApi

java
public final class WardApi {
  public static Ward raise(ServerLevel level, UUID owner, Vec3 centre, double senseRadius, Bulwark.Listener listener);
  public static boolean warn(ServerLevel level, String modId, Threat.Kind kind, Vec3 at, double radius, int argb, int lead, int duration);
  public static boolean warn(ServerLevel level, Threat threat);
  public static Shape dome(double radius);
  public static Shape wall(double nx, double nz, double offset, double halfWidth, double height, double depth);
  public static Shape bowl(double radius, double lift);
  public static Shape everywhere();
}

AimApi ​

cyou.rimuru.rimulib.api.AimApi

java
public final class AimApi {
  public static Vec3 ground(ServerPlayer player, double range, double fallback);
  public static LivingEntity creature(ServerPlayer player, double range);
}

NetApi ​

cyou.rimuru.rimulib.api.NetApi

java
public final class NetApi {
  public static <T extends CustomPacketPayload> void toServer(CustomPacketPayload.Type<T> type, StreamCodec<RegistryFriendlyByteBuf, T> codec);
  public static <T extends CustomPacketPayload> void toClient(CustomPacketPayload.Type<T> type, StreamCodec<RegistryFriendlyByteBuf, T> codec);
  public static <T extends CustomPacketPayload> void receive(CustomPacketPayload.Type<T> type, RimuNet.Handler<T> handler);
  public static void send(ServerPlayer player, CustomPacketPayload payload);
  public static boolean canSend(ServerPlayer player, CustomPacketPayload.Type<?> type);
}

UiApi ​

cyou.rimuru.rimulib.client.api.UiApi

java
public final class UiApi {
  public enum Font {
    DISPLAY,
    LABEL,
    MONO;
  }
  public static void overlay(GuiGraphics g, Runnable draw);
  public static void onMenuDraw(BiConsumer<GuiGraphics, Float> draw);
  public static int width(GuiGraphics g);
  public static int height(GuiGraphics g);
  public static float text(GuiGraphics g, Font font, String s, float x, float y, int argb);
  public static float centred(GuiGraphics g, Font font, String s, float x, float y, int argb);
  public static float text(GuiGraphics g, Font font, String s, float x, float y, float align, float scale, int argb);
  public static float measure(GuiGraphics g, Font font, String s, float scale);
  public static void box(GuiGraphics g, float x, float y, float w, float h, int argb);
}

FilmApi ​

cyou.rimuru.rimulib.client.api.FilmApi

java
public final class FilmApi {
  public static void enableKey();
  public static Subject follow(Entity entity, Vec3 target);
  public static CameraPose pose(Vec3 position, Vec3 look, float fov);
  public static Shot cut(int start, int end, Shot.Path path);
  public static Shot sweep(int start, int end, int blendIn, Shot.Path path);
  public static Cutscene film(Subject subject, String tier, String title, int color, List<Shot> shots);
  public static void play(Cutscene film);
  public static boolean active();
  public static float time(Subject subject, float partial);
  public static float weight(Subject subject);
  public static boolean automatic();
  public static void skip();
  public static void stop(Subject subject);
  public static void hintOnly(String modId);
  public static void holdInput(BooleanSupplier rule);
  public static void hideHand(BooleanSupplier rule);
}

FxApi ​

cyou.rimuru.rimulib.client.api.FxApi

java
public final class FxApi {
  public interface Layer {
    void draw(Frame frame);
  }
  public static Stage stage(String modId);
  public static final class Frame {
    public void pass(String program, Consumer<Uniforms> setup);
    public ScreenFx screen();
    public float partial();
  }
  public static final class Stage {
    public Stage add(Layer layer);
    public Stage remove(Layer layer);
  }
}

cyou.rimuru.rimulib.client.api.MenuApi

java
public final class MenuApi {
  public static WhiteSpaceSource source(String modId);
  public static void open();
  public static boolean isOpen();
  public static boolean capturesInput();
  public static Skill binding();
  public static void onKey(IntPredicate hook);
  public static KeyMapping key(Skill skill);
  public static KeyMapping menuKey();
  public static KeyMapping filmKey();
  public static void ownScreen(SkillSet set, Consumer<ItemStack> open);
  public static void lock(SkillSet set, LockedSkill... skills);
}

NetClientApi ​

cyou.rimuru.rimulib.client.api.NetClientApi

java
public final class NetClientApi {
  public static <T extends CustomPacketPayload> void receive(CustomPacketPayload.Type<T> type, RimuNetClient.Handler<T> handler);
  public static void send(CustomPacketPayload payload);
  public static boolean canSend(CustomPacketPayload.Type<?> type);
}