oh hi it does something
This commit is contained in:
parent
d2066d8e5d
commit
572b8e9783
2 changed files with 16 additions and 2 deletions
|
@ -1,5 +1,8 @@
|
||||||
package xyz.minecommune.micomc;
|
package xyz.minecommune.micomc;
|
||||||
|
|
||||||
|
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
|
||||||
|
import net.minecraft.server.command.CommandManager;
|
||||||
|
import net.minecraft.text.Text;
|
||||||
import org.quiltmc.loader.api.ModContainer;
|
import org.quiltmc.loader.api.ModContainer;
|
||||||
import org.quiltmc.qsl.base.api.entrypoint.ModInitializer;
|
import org.quiltmc.qsl.base.api.entrypoint.ModInitializer;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
@ -10,10 +13,21 @@ public class MicoMc implements ModInitializer {
|
||||||
// This logger is used to write text to the console and the log file.
|
// This logger is used to write text to the console and the log file.
|
||||||
// It is considered best practice to use your mod name as the logger's name.
|
// It is considered best practice to use your mod name as the logger's name.
|
||||||
// That way, it's clear which mod wrote info, warnings, and errors.
|
// That way, it's clear which mod wrote info, warnings, and errors.
|
||||||
public static final Logger LOGGER = LoggerFactory.getLogger("Example Mod");
|
public static final Logger LOGGER = LoggerFactory.getLogger("MicoMc");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInitialize(ModContainer mod) {
|
public void onInitialize(ModContainer mod) {
|
||||||
LOGGER.info("Hello Quilt world from {}!", mod.metadata().name());
|
LOGGER.info("Hello Quilt world from {}!", mod.metadata().name());
|
||||||
|
CommandRegistrationCallback.EVENT.register(
|
||||||
|
(dispatcher, registryAccess, enviroment) ->
|
||||||
|
dispatcher.register(
|
||||||
|
CommandManager.literal("foo").executes(context -> {
|
||||||
|
context
|
||||||
|
.getSource()
|
||||||
|
.sendFeedback(() -> Text.literal("hii"), false);
|
||||||
|
return 1;
|
||||||
|
})
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,5 +35,5 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"mixin": "mico-mod.mixins.json"
|
"mixin": "micomc.mixins.json"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue