Topic category: Help with Minecraft modding (Java Edition)
would this codework for minecraft 1.20:
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import java.util.ArrayList;
import java.util.List;
List<IRecipe<?>> recipes = new ArrayList<>();
List<IRecipe<?>> craftingRecipes = CraftingManager.getInstance().getRecipeList();
recipes.addAll(craftingRecipes);
for (IRecipe<?> recipe : recipes) {
System.out.println(recipe.getId());
}
and this code in the same procedure:
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
List<IRecipe<?>> recipes = new ArrayList<>();
List<IRecipe<?>> craftingRecipes = CraftingManager.getInstance().getRecipeList();
recipes.addAll(craftingRecipes);
Collections.shuffle(recipes);
for (IRecipe<?> recipe : recipes) {
System.out.println(recipe.getId());
}
Please help!!!!!!
All of the code will need to be put into a class for this to work.
Updated code:
Just want to say, if you want to know if it works, just *try it out*.