Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[1.12] How to add recipe in game


WildHeart
 Share

Recommended Posts

Just now, WildHeart said:

Hmm, but if I use 1.11 addRecipe? Especially in 1.12 no json recipes melting and boiling foul potions.

I have no idea what you are trying to say.

 

What are you trying to achieve? I cannot think of anything that would require adding recipes mid-game.

Link to comment
Share on other sites

5 minutes ago, diesieben07 said:

Why? You talked about custom NPCs, but clearly that is not your mod, is it? Please explain your exact use-case.

Yes, it's not my mod. I need it because I already have the object, which is registered once and I do a lot of different, to change NBT data, tooltips, etc. Now I am faced with the problem of recipes for these items and the substitution of the textures, depending on NBT data. The substitution of the textures and icons should occur for the specific item with a specific nbt data, with recipes as well. I will be glad if you can help me in this matter.

Link to comment
Share on other sites

11 minutes ago, diesieben07 said:

You have said nothing.

Please describe the recipes from an end-user perspective, not how you intend to code it.

Hrm, the player puts things in slots(3 x 3 in the bench) and puts it in the slot results in a single object. In the menu, the player clicks "save" and the recipe is saved in my data file, which is stored in the world. Then if the player opens the menu "library", he can choose the item you created earlier, click "to" and then the mod takes the stack and puts to him all that was stated previously and adds to the world the recipe for this item.

Link to comment
Share on other sites

4 minutes ago, diesieben07 said:

You will have to write a custom recipe implementation which manages all stored patterns.

This is understandable, but how to make the recipes available in the workbench without restarting? And how can you make the implementation with textures and icons, about which I wrote above?

Link to comment
Share on other sites

Just now, WildHeart said:

This is understandable, but how to make the recipes available in the workbench without restarting?

You don't make new recipes. You have one recipe which represents whatever "custom recipes" the user created. This recipe is registered once at startup.

 

1 minute ago, WildHeart said:

And how can you make the implementation with textures and icons, about which I wrote above?

You need a normal container GUI with inventory, etc.

Link to comment
Share on other sites

4 minutes ago, diesieben07 said:

You don't make new recipes. You have one recipe which represents whatever "custom recipes" the user created. This recipe is registered once at startup.

 

You need a normal container GUI with inventory, etc.

You do not understand, I mean, how can I change the texture of the object directly in the game? See, before 1.7.10 was setTexture method and getIcon(or something similar) and it was possible to prescribe a different texture, and all would have worked, but how to do it on 1.8++ I have no idea.

Link to comment
Share on other sites

If there is a fixed set of textures you can create different models for your item and switch between them using ItemMeshDefinition (registered with ModelLoader.setCustomMeshDefinition), you will need to register every one of these models using ModelBakery.registerItemVariants.

 

If you need "infinite models" (i.e. the model could be any model from any other item) you need a custom runtime model implementation, you will need to implement IModelLoader, IModel, IBakedModel.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Im trying to make a moddes server with my friends but every single time we get same error https://pastebin.com/UP6P6YSd Is there a way to fix it? Thanks for solutions
    • Take a break, go for a walk. Then try again. 🙂
    • Where did you see that? Sorry if I am being a bother, it's just that I have been staring at this mod for a long time and I'm probably looking over a lot of things
    • Taking a look at AbstractContainerScreen.renderSlot() I got the following code: Method created in my AbstractContainerScreen class: private void renderCustomSlot(PoseStack poseStack,ItemStack itemstack,int x, int y) { boolean visible = true; boolean hover = false; this.setBlitOffset(100); this.itemRenderer.blitOffset = 100.0F; if (visible) { if (hover) { //Draw a rectangle behind the item fill(poseStack, x, y, x + 16, y + 16, -2130706433); } //Render item icon RenderSystem.enableDepthTest(); this.itemRenderer.renderAndDecorateItem(this.minecraft.player, itemstack, x, y, x + y * this.imageWidth); //Render item string count PoseStack posestack = new PoseStack(); if (itemstack.getCount() != 1) { String s = String.valueOf(itemstack.getCount()); posestack.translate(0.0D, 0.0D, itemRenderer.blitOffset + 200.0F); MultiBufferSource.BufferSource multibuffersource$buffersource = MultiBufferSource.immediate(Tesselator.getInstance().getBuilder()); /* float scale; if (s.length()<3){ scale=1f; }else if (s.length()<4){ scale = 0.75f; }else { scale=0.5f; s = s.substring(0,s.length()-3)+"k"; } float compensatingScale = 1/scale; float stringX = (x + 19f - 2 - font.width(s)*scale)*compensatingScale; float stringY =(y + 6f + 3)*compensatingScale; posestack.scale(scale,scale,scale); */ float stringX = (x + 19f - 2 - font.width(s)); float stringY =(y + 6f + 3); font.drawInBatch(s,stringX,stringY,16777215, true, posestack.last().pose(), multibuffersource$buffersource, false, 0, 15728880); //posestack.scale(compensatingScale,compensatingScale,compensatingScale); multibuffersource$buffersource.endBatch(); } } this.itemRenderer.blitOffset = 0.0F; this.setBlitOffset(0); } Now it works correctly: Thanks to warjort for the tip!
    • Hello, I am currently trying to get a forge server setup so I can play the Pixelmon mod with some friends on a private server and have run into some issues with launching my forge server file, I downloaded the forge 12.2.2-14.23.5.2859 installer, downloaded it into a folder on my desktop, ran the Mc server file, agreed to Eula, made a run.bat file to launch the forge server at 6GBs, and when I try launching I get this issue: Pixelmon Server>java -Xmx6144M -Xms6144M -jar forge-1.12.2-14.23.5.2859-universal.jar --nogui We appear to be missing one or more essential library files. You will need to add them to your server before FML and Forge will run successfully.java.lang.ClassNotFoundException: org.objectweb.asm.Type         at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:636)         at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:182)         at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519)         at java.base/java.lang.Class.forName0(Native Method)         at java.base/java.lang.Class.forName(Class.java:466)         at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.run(ServerLaunchWrapper.java:53)         at net.minecraftforge.fml.relauncher.ServerLaunchWrapper.main(ServerLaunchWrapper.java:34)   I've tried using another minecraft server jar file from a different source to see if that would solve anything but its still coming up with this issue. Any help is greatly appreciated, thanks for your help in advance.
  • Topics

×
×
  • Create New...

Important Information

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