fuecocco

can you make me a Minecraft mod where every five minutes and every achievement i get it gives me a random quiz question that i need to get right or i die basing the quiz question of marine sciences like ocean zones, life zones, and anything else with oceanology

Kodari AI
KodariOct 26 at 11:26 am 2
OceanQuizOrDeath
OceanQuizOrDeath is a Fabric mod that challenges players with marine science trivia. Every five minutes of gameplay and upon earning any achievement, a random quiz question appears covering ocean zones, life zones, marine biology, and oceanography. Players must answer correctly within a time limit or face instant death. The mod features a custom GUI for answering questions, configurable difficulty levels, and a question bank of ocean-related topics to test players' knowledge while exploring the world.
  1. Create a Fabric 26.3 mod scaffold and register quiz triggers.

  2. Implement a five-minute timer, advancement-triggered quizzes, chat answers, and death on a wrong answer.

  3. Add marine-science question content and player-facing instructions.

Created the Marine Science Quiz Fabric 26.3 mod. Every five minutes, each online player gets a random quiz; completing an advancement triggers another. Type your answer in chat: correct answers clear the question, while a wrong answer kills you. Questions cover ocean zones, marine life, and ocean processes.

The timer counts game ticks, so lag or a paused server can make the interval longer than five real-world minutes. No items or blocks were added.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
marine stuff
settings.gradle
Code
10 255
src/main/java/com/kodari/marinequiz/MarineQuizMod.java
package com.kodari.marinequiz;

import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
import net.fabricmc.fabric.api.message.v1.ServerMessageEvents;

public final class MarineQuizMod implements ModInitializer {
	private static final int TICKS_PER_QUIZ = 5 * 60 * 20;
	private int elapsedTicks;

	@Override
	public void onInitialize() {
		ServerTickEvents.END_SERVER_TICK.register(server -> {
			if (++elapsedTicks >= TICKS_PER_QUIZ) {
				elapsedTicks = 0;
				server.getPlayerList().getPlayers().forEach(QuizManager::triggerQuiz);
			}
		});

		ServerMessageEvents.ALLOW_CHAT_MESSAGE.register((message, sender, boundChatType) ->
				QuizManager.handleAnswer(sender, message.signedContent()));
	}
}