You are browsing as a guest. Sign up (or log in) to start making projects!

Ink And Quill

  • 4 Devlogs
  • 14 Total hours

It is a QOL Minecraft Mod.This mod adds a new Item called Ink and Quill , that can be used to create maps , rename name tags and items without using an Anvil and Experience This mod is port and upgrade of the [Ink and Quill](https://modrinth.com/mod/inkandquill) by [Stasidzie](https://modrinth.com/user/Stasidzie)

Open comments for this post

44m 7s logged

Since I am waiting for modrinth to verify the mod. I made some more improvement to the mod.

From now on you can play this mod on a dedicated server.

Yes before that was not possible but now it is.

Why Was This Even an Issue

due to this , the server was importing a class that it had no idea of and hence the crash.

So What Did I Do to Achieve This

with this I created two more classes , one for server and other for client , both of which implemented the Interface I just created.

The server class just souted that you are using the wrong method please check your code.

The Client Class had the actual screen code and did the actual stuff.

Now I made it so that when the item is running in server , the server class will be loaded and once the clients connect the client method would be loaded in and take priority.

Kinda hard but not that much

0

Loading discussion…

0
2
Open comments for this post

2h 51m 46s logged

The Mod Is Actually Done Now

What the Issue Was

For some reason the mod worked fine for a couple of days, it had no problem with beta testing and stuff.

When I handed it to the requester, he claimed that the item names weren’t staying( persistent ).

e.g. he renamed the Name Tag to be say wolfy, It would show up as wolfy for a second until he interacted with it.

Which is weird since when I tested it , it was working perfectly fine.

So created a new instance of Minecraft and did the testing again , this time even I was getting the issue.

in my old instance the mod worked fine and even in IntelliJ’s runClient instance it worked fine.
This issue was getting annoying as well now.


So What was the issue

The worst kind of issue, the cause was that if you renamed the item during the starting of a tick then it would work just fine( no clue , why).

1/20th of second is called a tick.

But if it during the tick , the server won’t sync with the changes and this would create a ghost item , that exist in client only.

now why did the dev tool kit not show this error:
this is due to low performance of dev kit due to high ram.


How Did I Actually Fix This

before the tick Minecraft was doing this sync between client and server dynamically for my item ( there was no sync logic ).

The fix was to delve into networking and create a packet that had my custom payload , now the server would read this payload every time it receives it , not just at the start of the tick.

This solved the issue pretty quickly.

The majority of time I spent on this issue was figuring out the reason behind it

0

Loading discussion…

0
1
Open comments for this post

6h 25m 48s logged

Completed Ink and Quill

Everything About the Mod

  • this mod is a QOL for Minecraft, it targets anvil , more accurately, the renaming ablity of anvil.
  • which item can be renamed by the quill is written in the
    inkquill:ink_and_quill_renameable tag
  • It can help in crafting of Maps.

technicalities

this mod is extremely technical with datagen and Screen, and while the lines are pretty simple and limited , the sheer amount of trial and error , I had to go trough makes it hard for someone just starting out in modding.
That being said , if you do which to make something similar , you should try this.

The making of this mod tested both the registries of Minecraft.

How and when these registries loaded and what part of them did not load at all, yes , inbuilt tags aren’t loaded during datagen.

And most importantly how quickly you can copy and paste vanilla code( that being said , addapting it for your mod is the tought part , alot of the classes are either protected or private , some time you have to do a mixin, not reallly for this mod but you will if you do some complex level modding)

The entire concept of GUI in minecraft is interesting you let it grow on you

Rant

My biggest pet peeve is why the hell does two gui components require different type of identifier
one needs the exact path and the other needs just the resourcekey , why mojang just pick a side and stick to it.

The sheer amount of time I had spent trying to figure out why the gui’s texture was not loading only to find that I forgot to add .png extension in one identifiers path.

Also why does the Builder of SpriteIconButton not allow for uv configs . I would have to use only one texture and it would have been so easy , but no ,they want each icon to be a single file.

Conclusion

Well I finished it.
It took way longer than what I was expectation, but I guess that true for all my projects.

Here is a demo of the entire mod, will publish it once the modrinth page is verified

till then github

0

Loading discussion…

0
1
Open comments for this post

4h 9m 37s logged

Okay what I did
Created two new Items called

  • Ink and Quill
  • Bottle of Ink

Added Recipes for the above as well


Rant

I wrote a hole ass para but stardance does not allow no more than 4000 words so I will try to keep it concise

back in the day ( 5 years from now ) minecraft used to have NBT data, this is the time when I picked modding, before that I had been doing datapacks.

now In this 5 five years , I have taken a 1.5 year break due to some personal reason (nothing major mind you )

2 years ago minecraft removed the NBT compound and replaced it with DataComponenet
DataComponents are better in all regards( keep this in mind )

Now my major issue is that I want to make sure that only water potion is used for crafting ink, not any other potion
So I had some understanding that using Datacomponents would work
The problem occured when I tried this approch, unfortunatly for me, ItemLike’s cant’ have datacomponents since they are Interfaces and Potions could not have been accessed as an Item

So I had to dig into a rabit hole to find something similar that minecraft it self did, and I did
tinted arrow , it need to know the type of potion for the arrow to have that effect

now the problem was that this required a customcrafting system for my potion.

During this rabit hole I also stumbled at the core of shapless crafting and Shaped Crafting

and when reading the Shapeless crafting , turns out , in the underling code , the crafting needs Ingredients. normaly this would have no effect and I would have continued .

But luckly I knew that fabric had a means to store datacomponent on Ingredients
using

DataComponentPatch data  = DataComponentPatch.builder().set(DataComponents.POTION_CONTENTS,new PotionContents(Potions.WATER)).build();Ingredient potion =  Ingredient.of(Items.POTION);Ingredient potionIng = DefaultCustomIngredients.components(potion,data);

and then registering a custom shapeless recipe to use core feature, I did it

CustomCraftingRecipeBuilder.customCrafting(RecipeCategory.BREWING,(commonInfo, craftingBookInfo) ->                new ShapelessRecipe(commonInfo,craftingBookInfo                        ,new ItemStackTemplate(InkQuillItems.BOTTLE_OF_INK,1),                        List.of(potionIng,Ingredient.of(Items.DYE.black()))))        .unlockedBy("has_black_dye",has(Items.DYE.black()))        .save(output, InkQuill.id("bottle_of_ink").toString());
0

Loading discussion…

0
2

Followers

Loading…