Yatharth Sugandhi

Can you remake the whole Sift Mod into a paper plugin

Kodari AI
KodariNov 1 at 11:47 am 1
SiftModPaper
Converts the Sift Mod into a comprehensive Paper plugin, replicating its core gameplay mechanics. Implements custom sifting mechanics where players use sieves on block entities to obtain resources, with configurable drop tables for various soil types. Includes custom item definitions, GUI-based sieve interfaces, and block state management. Features permission-based crafting recipes, cooldown systems, and integration with Paper's event system. Provides full configuration files for drop rates, block types, and item properties, ensuring seamless migration from the original mod experience to a server-side plugin environment.

Send the Sift Mod’s Modrinth, CurseForge, or GitHub link and the Minecraft/Paper version you’re targeting. There are multiple projects called “Sift,” and I need the exact one to port its features faithfully.

Yatharth Sugandhi

https://modrinth.com/mod/mielons-the-sift/gallery?version=26.2&loader=fabric

plz make it for version 26.2

Kodari AI
KodariNov 1 at 11:57 am 1
  1. Set up a Paper 26.2 plugin project and custom Sift world generator.

  2. Implement the playable core: portal melody, timed rifts, Ichor, custom items, and mob behaviors.

  3. Register /sift commands and package metadata; use vanilla visuals where Paper cannot register modded assets.

Created the Paper 26.2 project with a generated Sift world and a playable core: /sift travel and setup commands, the eight-note portal sequence, five-minute rifts, Ichor effects, custom-tagged items, mob stand-ins, and Siftite death recovery.

This is not yet a feature-for-feature port. Paper plugins can’t register the mod’s actual custom dimension, biomes, blocks, or entity types, so this version uses vanilla stand-ins. The full biome and structure generation, plant and wood families, custom visuals, advanced mob behaviors, and Charoite enchanting still need to be recreated or approximated.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
5 693
src/main/java/com/kodari/sift/SiftPlugin.java
package com.kodari.sift;

import com.cryptomorin.xseries.XMaterial;
import com.cryptomorin.xseries.XPotion;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.World;
import org.bukkit.WorldCreator;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.block.data.type.NoteBlock;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Rabbit;
import org.bukkit.entity.Sniffer;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.potion.PotionEffect;
import org.bukkit.util.Vector;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.UUID;

public final class SiftPlugin extends JavaPlugin implements Listener, CommandExecutor, TabCompleter {
    private static final String SIFT_WORLD = "TheSift";
    private static final List<Integer> PORTAL_MELODY = Arrays.asList(1, 3, 7, 6, 5, 2, 4, 8);
    private static final Set<String> SIFTITE_EQUIPMENT = Set.of(
            "siftite_sword", "siftite_pickaxe", "siftite_axe", "siftite_shovel", "siftite_hoe",
            "siftite_spear", "siftite_helmet", "siftite_chestplate", "siftite_leggings", "siftite_boots"
    );

    private final Set<String> noteBlocks = new HashSet<>();
    private final Set<String> ichorBlocks = new HashSet<>();
    private final Map<UUID, List<Integer>> melodyProgress = new HashMap<>();
    private final Map<String, Block> activeRiftBlocks = new HashMap<>();
    private final Map<String, BlockState> riftOriginalBlocks = new HashMap<>();
    private final Map<String, Long> riftExpiries = new HashMap<>();
    private final Map<UUID, List<ItemStack>> recoveries = new HashMap<>();
    private NamespacedKey itemKey;
    private NamespacedKey mobKey;
    private NamespacedKey ownerKey;
    private NamespacedKey deliveryKey;

    @Override
    public void onEnable() {
        itemKey = new NamespacedKey(this, "item");
        mobKey = new NamespacedKey(this, "mob");
        ownerKey = new NamespacedKey(this, "owner");
        deliveryKey = new NamespacedKey(this, "last_delivery");
        getServer().getPluginManager().registerEvents(this, this);
        getCommand("sift").setExecutor(this);
        getCommand("sift").setTabCompleter(this);
        getSiftWorld();
        getServer().getScheduler().runTaskTimer(this, this::tick, 20L, 20L);
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (args.length == 0) {
            sender.sendMessage(ChatColor.DARK_AQUA + "The Sift: /sift enter, /sift return, /sift portal");
            sender.sendMessage(ChatColor.GRAY + "Admin: /sift altar, /sift ichor, /sift spawn <mob>, /sift give <item> [amount]");
            return true;
        }

        String subcommand = args[0].toLowerCase(Locale.ROOT);
        if (!(sender instanceof Player player)) {
            sender.sendMessage("This command requires a player.");
            return true;
        }

        switch (subcommand) {
            case "enter" -> {
                World world = getSiftWorld();
                player.teleport(safeLocation(world, 0, 0));
                player.sendMessage(ChatColor.DARK_AQUA + "You enter The Sift.");
            }
            case "return" -> {
                World world = getOverworld();
                if (world == null) {
                    player.sendMessage(ChatColor.RED + "No Overworld is loaded.");
                    return true;
                }
                player.teleport(safeLocation(world, player.getLocation().getBlockX(), player.getLocation().getBlockZ()));
            }
            case "portal" -> {
                createRift(player.getLocation());
                player.sendMessage(ChatColor.LIGHT_PURPLE + "A temporary Rift opens for five minutes.");
            }
            case "altar" -> {
                if (!requireAdmin(player)) return true;
                createAltar(player);
                player.sendMessage(ChatColor.DARK_AQUA + "An eight-note Sonorous altar has been created at your feet.");
            }
            case "ichor" -> {
                if (!requireAdmin(player)) return true;
                Block block = player.getLocation().getBlock();
                block.setType(material("WATER"), false);
                ichorBlocks.add(key(block));
                player.sendMessage(ChatColor.LIGHT_PURPLE + "Ichor placed. It restores nearby living entities.");
            }
            case "spawn" -> {
                if (!requireAdmin(player)) return true;
                if (args.length < 2 || !spawnSiftMob(player.getLocation(), args[1])) {
                    player.sendMessage(ChatColor.RED + "Use /sift spawn <blub|sifter|dark_sniffer|singer|echo_golem>.");
                }
            }
            case "give" -> {
                if (!requireAdmin(player)) return true;
                if (args.length < 2) {
                    player.sendMessage(ChatColor.RED + "Use /sift give <item> [amount].");
                    return true;
                }
                int amount = 1;
                if (args.length > 2) {
                    try {
                        amount = Math.max(1, Math.min(64, Integer.parseInt(args[2])));
                    } catch (NumberFormatException exception) {
                        player.sendMessage(ChatColor.RED + "Amount must be a number.");
                        return true;
                    }
                }
                ItemStack item = createItem(args[1].toLowerCase(Locale.ROOT));
                if (item == null) {
                    player.sendMessage(ChatColor.RED + "Unknown item. Try soul_block, ichor_bottle, ichor_bucket, charoite, siftite_ingot, echo_shard, or siftite equipment.");
                    return true;
                }
                item.setAmount(amount);
                player.getInventory().addItem(item).values().forEach(stack -> player.getWorld().dropItemNaturally(player.getLocation(), stack));
            }
            default -> player.sendMessage(ChatColor.RED + "Unknown subcommand. Use /sift for help.");
        }
        return true;
    }

    @Override
    public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
        if (args.length == 1) {
            return matching(args[0], List.of("enter", "return", "portal", "altar", "ichor", "spawn", "give"));
        }
        if (args.length == 2 && args[0].equalsIgnoreCase("spawn")) {
            return matching(args[1], List.of("blub", "sifter", "dark_sniffer", "singer", "echo_golem"));
        }
        if (args.length == 2 && args[0].equalsIgnoreCase("give")) {
            return matching(args[1], List.of("soul_block", "ichor_bottle", "ichor_bucket", "charoite", "siftite_ingot", "siftite_sword", "siftite_pickaxe", "siftite_axe", "siftite_shovel", "siftite_hoe", "siftite_spear", "siftite_helmet", "siftite_chestplate", "siftite_leggings", "siftite_boots", "echo_shard"));
        }
        return List.of();
    }

    @EventHandler
    public void onInteract(PlayerInteractEvent event) {
        if (event.getHand() != null && event.getHand().name().equals("OFF_HAND")) return;
        Block clicked = event.getClickedBlock();
        if (clicked != null && noteBlocks.contains(key(clicked))) {
            if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
                event.setCancelled(true);
                if (clicked.getBlockData() instanceof NoteBlock noteBlock) {
                    int next = (noteBlock.getNote().getId() + 1) % 8;
                    noteBlock.setNote(new org.bukkit.Note(next));
                    clicked.setBlockData(noteBlock, false);
                    event.getPlayer().sendMessage(ChatColor.AQUA + "Sift note set to " + (next + 1) + ".");
                }
                return;
            }
            if (event.getAction() == Action.LEFT_CLICK_BLOCK) {
                event.setCancelled(true);
                playPortalNote(event.getPlayer(), clicked);
                return;
            }
        }