Jump to content

NathaFred

Members
  • Posts

    17
  • Joined

  • Last visited

NathaFred's Achievements

Tree Puncher

Tree Puncher (2/8)

1

Reputation

  1. This is exactly the problem I was trying to solve in this thread. A recipe is only actually overridden if the shape and ingredients are the same. In other words, if you create an identical recipe to the wooden pickaxe but set the output to air, you will find that it is impossible to craft a wooden pickaxe. So the steps to take if you want to change or replace a recipe are: 1. create a recipe with the desired ingredients and output 2. create a recipe identical to the vanilla recipe, but outputting air 3. create an identical advancement to the vanilla and have it reward your custom recipe (and change criteria as needed) 4. create an impossible advancement to override the vanilla one, since the vanilla advacement will give the player a recipe that no longer works. In step four the .json file must be named the same as the vanilla advancement and be placed in the same location in the data folder. Like I said before you can find all the vanilla advancements if you go to your external libraries and look under net.minecraft:client:extra:1.16.1. These are the steps that I went through in this thread and should get you the same result.
  2. Why do I keep doing this! I just found them 🤦‍♂️ okay it's under the decorations folder not decoration... and it is called grindstone. Edit It works... For anyone wondering where the advancements and a bunch of other stuff is: net.minecraft:client:extra:version-number (at least for now)
  3. That's the thing, I can't find any vanilla .json advancements... I'm sure they're there somewhere but I have looked through everything and can't find them!
  4. Your file does indeed work when it is named bone_meal.json, however if I try to use it for the grindstone it doesn't work. I tried a bunch of names and directories. None of these configurations work. How should I name this file, and where should I put it?
  5. Hmm... So when the player gets a stone slab, the advancement that I need to override gives you the grindstone recipe... I am not sure how your example works as it just creates a new impossible advancement. It doesn't seem like it is tied to bone meal at all unless the name matters. I have tried putting that file, with the name "grindstone.json" under data/minecraft/advancements/ data/minecraft/advancements/recipes data/minecraft/advancements/minecraft/recipes data/advancements/recipes data/advancements/minecraft/recipes none have nulled the original advancement. Is there something I am not realizing here? Also, I have so many worlds now because every time I test it I have to create a new one to test the advancement XD
  6. Isn't it weird how when you explain things suddenly you realize whats wrong!? Well, I figured it out. I am not sure what specifically was wrong in that .json, but I changed a bunch of things and put it in the resources/data/minecraft/advancements folder, and it works! Here is the new .json. You have to use your mod-id namespace for the reward recipe, and it seems the "data": 0 line was wrong. So if you need an example of how to add a new recipe advancement, here one is! { "criteria": { "inv_changed-diamond": { "trigger": "minecraft:inventory_changed", "conditions": { "items": [ { "item": "minecraft:diamond" } ] } } }, "rewards": { "recipes": [ "nmgrepair:grindstone_override" ] } } Now I just have to figure out how to override/ remove the other one...
  7. Hmm... Well this is harder than I thought it would be. I can't find anything online or in the vanilla code... A lot of people have said the advancement should be added in the data pack as a .json, and the minecraft wiki agrees with that. However, I cannot find a good example of an advancement json. I found an advancement .json generator online, but it dosen't work so either it's outdated, or I did something wrong. Here is my .json file that the website generated. { "display": { "description": "", "title": "", "show_toast": false, "announce_to_chat": false, "background": "minecraft:textures/blocks/stone.png" }, "criteria": { "inv_changed-diamond": { "trigger": "minecraft:inventory_changed", "conditions": { "items": [ { "item": "minecraft:diamond", "data": 0 } ] } } }, "rewards": { "recipes": [ "grindstone_override" ] }, "requirements": [ [ "inv_changed-diamond" ] ] } I placed this file in resources/data/mod-id/advancements and resources/data/minecraft/advancements. Neither did anything. I am assuming that the recipe string should hold the name of the recipe file, but I don't know if that is true. Also the "data": 0 line is kinda sus...
  8. Ah, so I can override the advancement by giving it a dummy, and implement a new advancement for the override.
  9. Yes that's true.On a very related subject, the problem now is that both recipes show up in the recipe book. The dummy one shows up for the normal advancement, and the override shows up once the dummy one is viewed. Is there any way to remove the dummy from the book? I think I can set up a custom advancement for the override.
  10. Okay so I figured it out. Maybe this is the normal way of doing it, but I don't know. The name of the recipe .json file doesn't matter since the output item is stated inside the .json. This way you create two files, one to override the old recipe and another with the updated recipe. The override recipe is identical to the vanilla one but with an output of air. Also both recipies must be in the resources/data/mod-id/recipes folder not the /minecraft folder. Please correct me if this isn't the best way to do this, but it works.
  11. I believe you mean just placing a .json file into the recipes folder. If I try to override the recipe by placing an edited .json of the same name into resources/data/minecraft/recipes nothing changes. If I put it into resources/data/mod-id/recipes it adds the recipe so both the vanilla and modded way works. I know my /minecraft folder works because I have successfully overridden a loot table there. I do have a number of non-datapack features in my mod if that makes any difference.
  12. Basically, I want to change a vanilla recipe to use slightly different ingredients. Many other solutions to this problem use this event: @SubscribeEvent public static void RegistryRecipe(RegistryEvent.Register<IRecipe> event){ //remove recipe entry } However, this gives an error: " Type parameter 'net.minecraft.item.crafting.IRecipe' is not within its bound; should extend 'net.minecraftforge.registries.IForgeRegistryEntry<net.minecraft.item.crafting.IRecipe>' " So I believe this has changed in version 1.16. Additionally the Forge Documentation (1.15.x) states this should work. I am wondering if there is any way to do this now, or if it has changed to some other way, or maybe I am doing something wrong? Thanks!
  13. 1. Yeah I figured that was wrong. I should get into the habit of searching the vanilla code for usage examples. 2. I am repairing the item, so that was intended. It still does nothing even with the same implementation as vanilla... if (heldItem.isDamageable()) { heldItem.damageItem(8, player, (p_220017_1_) -> {p_220017_1_.sendBreakAnimation(Hand.MAIN_HAND);} ); LOGGER.info(heldItem.getDamage()); } I kept the same Consumer name as vanilla just in case but that doesn't change anything. I am not sure what is wrong, as it was working for a few minutes seemingly. However, I now cannot get it to do anything...
  14. So it is! XD So after a number of iterations I finally fixed part of my problem. I found that any Event not located under the .client namespace is a server event. So I just had to make sure event.getWorld().isRemote was false. The problem I have now is that item.damageItem() does not work whereas item.setDamage does. I am currently using setDamage and just adding the value that way, which is arguably simpler, but I would like to know why damageItem was failing. My updated code is here running on a server event: PlayerEntity player = event.getPlayer(); if(player.getHeldItemMainhand().isDamageable()) { Consumer<PlayerEntity> pl = (p) -> LOGGER.info(p); LOGGER.info(player.getHeldItemMainhand().getDamage()); //this line of code works //player.getHeldItemMainhand().setDamage(player.getHeldItemMainhand().getDamage() - 8); //this one does not player.getHeldItemMainhand().damageItem(-8,player,pl); LOGGER.info(player.getHeldItemMainhand().getDamage()); }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.