MonitoringMinecraft MonitoringMinecraft

Mod That Closes The Game When It Opens Mk.2

Мод Fabric

An experiment to make the smallest possible Fabric mod (with actual code). Does what the title says.

5 скачиваний 0 подписчиков
Оцените первым

An experiment to make the smallest possible Fabric mod (with actual code). Does what the title says.

So what't the drill?

The (self-imposed) rules are to make the smallest possible Fabric mod that "does something". The definition of that in my opinion is to run, or at least attempt to, some code. So what can be done with that?

  1. The class.

    public class a extends java.io.File {
        public a() {
            throw null;
        }
    }
    

    Although it looks simple, this is not valid Java - the compiled bytecode was manually modified to make it throw a null, and to remove this parameter in the initializer. Also, by default all classes extend java.lang.Object, so it was changed to java.io.File to save two letters.

  2. Mod metadata
    Abusing the fabric.mod.json format, it can be compacted down to

    {"id":"aa","version":"a","initializer":"a"}
    

    Back in 2019 Fabric used to have a different metadata format, which is still supported to this day! Thanks to it, the file doesn't need a schemaVersion field, or the complex entrypoints setup.

  3. Build process
    There are two files, so there isn't much to compress, but to squeeze the most of it, they are zipped with the zopfli compressor. It is possible to get a smaller file size with .xz format, but it wouldn't be possible to load as a mod in that case.

  4. Runtime
    Well, there isn't much code to ""do something"" - a no-op instruction would technically suffice, but I don't think it's interesting. So instead the code tries to throw an exception, and fails because it can't throw null. Task failed successfully, I guess…

Смотри также

Похожие подборки моды — по версиям Майнкрафта, загрузчикам и жанрам.

Сервера Майнкрафт

Играть интереснее на сервере — выбирай в рейтинге серверов Майнкрафт и заходи прямо сейчас.

SkyBars
SkyBars Java + BE
279 онлайн
1.8 — 26.2 версия
🎮 ВЫЖИВАНИЕ ⚔️ АНАРХИЯ 🚗 ГТА РП 🎤 ГОЛОСОВОЙ ЧАТ 🎁 БЕСПЛАТНЫЙ ДОНАТ 🌟 СМП 💻 ПК+ТЕЛЕФОН
Minestory
19 онлайн
1.21 — 26.2 версия
Выживание • Экономика • Кланы • Приваты • Ивенты • PVP • Работа
MineLandy
MineLandy Java + BE
25 онлайн
1.12.2 — 26.1.2 версия
Ванила и анархия без приватов — полная свобода действий и честное выживание
Amiverse
4 онлайн
26.2 — 1.21 версия
Ванильное выживание без гриферства, в приятной компании
MineLauncher
Лаунчер Майнкрафт без лицензии — все версии
Бесплатный лаунчер для ПК и Андроид — все версии 26.2, 1.21.11, 26.1.2, 1.16.5. Fabric, NeoForge, Forge, шейдеры, моды и скины в один клик.
Без лицензии Fabric, NeoForge, Forge Моды, шейдеры, скины Все версии Майнкрафта ПК и Андроид Для слабых ПК Сервера в лаунчере
Скачать бесплатно
Windows и Андроид · Бесплатно · Без лицензии
Наш чат