Jump to content

[1.16.1] Opening written book, and unexpected potion duplication


jackokring

Recommended Posts

Hi

 

So I managed to build without module errors. In test I found the potion registered custom potion (singular) shows up as a complete set of potions in the creative inventory (on the custom item group). This is unexpected. Did I use the correct parent model?

 

Also I added a written book with text json. I seem to be unable to open it to read it. It displays as the default brown book. No open to open it, but it does destroy blocks. I changed into survival mode too but it operates more like a hammer than a readable book.

 

https://github.com/jackokring/MinecraftMod for source.

Link to comment
Share on other sites

Pretty sure the "complete set" in the creative tab is expected behavior.

 

As for the book:

https://github.com/jackokring/MinecraftMod/blob/master/src/main/java/uk/co/kring/mc/Jacko.java#L267-L271

I don't see where you are setting its text.

33 minutes ago, jackokring said:

but it does destroy blocks

As do most items in creative mode...

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Offtopic: may i suggest you to organize better your mod code in different packages and classes? Right now its pretty messy, and its really small right now, but if you'll expand it and add more stuff i am 100% sure you won't be able to even remember where some things are placed or which portions of code are related to others. Just a suggestion, feel free to accept it or not 😉

 

Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port

Link to comment
Share on other sites

Custom tab itemGroup, so all mod items appear, but all potions I just added a PotionItem() with the model having a CustomPotionEffects in the json. The four redstone blocks appear with no functionality yet (will do this later).

 

I'm not sure where to set it's text, it's in the item model at the moment (an assumption). Do I have to sub class WrittenBookItem? Is it possible to make it readable by using a json file or does it need code to load the book content? I managed to fix 1 more error on in achievement recipes as i had a bad item name or 2.

Link to comment
Share on other sites

9 minutes ago, jackokring said:

I'm not sure where to set it's text, it's in the item model at the moment (an assumption).

What. This makes zero sense. Models are 3D models, which are client files.

10 minutes ago, jackokring said:

or does it need code to load the book content?

Written book content is NBT data. Go look at WrittenBookItem.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

18 minutes ago, jackokring said:

data/jacko/tags/items/book.json might be a suitable location for book text?

No, that's where tags go.

 

18 minutes ago, jackokring said:

and https://minecraft.gamepedia.com/Data_Pack seems to have some info

Dude:

https://minecraft.gamepedia.com/Written_Book#Item_data

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

itemP = new WrittenBookItem.Properties().group(customItemGroup);
        //.maxStackSize(BOOK_STACK_SIZE);
WrittenBookItem bookItem = new WrittenBookItem(itemP);
//the following 2 look like a read and write function pair
//bookItem.readShareTag();
//bookItem.getShareTag();
//perhaps it's bool false and a place where tags are for following 2 methods ...
//bookItem.shouldSyncTag();
//bookItem.getTags();
bookItem.setRegistryName(Jacko.MOD_ID, "book");
event.getRegistry().register(bookItem);

 

That's it for today as the "source" I've found is of the P_124141413413_?? variety.

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

Announcements



×
×
  • Create New...

Important Information

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