BVengo / simple-shulker-preview

A minecraft fabric mod that displays a configurable icon indicating the contents of a shulker box, as well as a capacity bar.
GNU Lesser General Public License v3.0
8 stars 8 forks source link

[Dum question] how set custom icon #25

Closed WolfgamingWG closed 3 months ago

WolfgamingWG commented 11 months ago

Describe the Bug

Am sorry for dumb question but I am very new to this mod and I've not been able to find a way to set a custom icon to shulkers, I can't find a description on it either, not on modrinth, github nor curseforge. Can someone please explain, thank you alot and sorry for dumb question.

Also maybe handy to add the how to on the pages so others won't have to go trough the same struggle. :)

Steps to Reproduce

N/A

Expected Behavior

N/A

Screenshots

No response

Fabric Version

No response

Mod Version

Latest

Log Output

No response

Additional Context

No response

BVengo commented 11 months ago

Hi there! No worries at all, no dumb questions here :)

I do have documentation for the mod settings on each of those pages, but they're not as verbose as they used to be since I added more settings. I think I'll make it a future goal to have all the settings properly listed at the very least on GitHub.

The answer to your question depends on what you mean by 'custom'. This mod doesn't support displaying your own custom images in the game, but instead displays an icon based on the contents of your shulker boxes.

You may have seen that one of the dependencies of this mod is ModMenu. It provides you with a list of all the mods you have installed and, if you hover over the mod, you'll see a config button appear that takes you to the mod settings screen.

In the settings for Simple Shulker Preview, there's an option called 'Display Item' that lets you adjust how your icon will be displayed:

There are also various other options for:

I hope this helped!

WolfgamingWG commented 11 months ago

Ah yeh that answers my question, I was thinking of asigning a item that is in the game to a shulker even when nothing is in the shulker, can this be turned into a suggestion if possible?

I would love to see this mod be able to display an item of choosing on the shulker regardless of what is in the shulker. Let's say I have a shulkerbox for end items, I want an enderpearl as icon but not necessarily keep enderpearls in said shulker.

A great example can be the mod called "Quick menu", a mod that allows quick chat msgs/commands that allows to pick a custom item for icon, if implementing a custom icon like that is possible I would love to see it added.

BVengo commented 10 months ago

Sorry for the delay in response.

This isn't really possible unfortunately, as there is no way for the game to 'remember' what your shulker box should display without adding NBT data (which would break multiplayer support). The only player-accessible method would be naming the shulker box, but that's dependent on the user 100% correctly naming the box by item id (I can foresee many issues being opened due to it not working, when somebody has simply mistyped it).

BVengo commented 3 months ago

Closing this as completed, thanks to the initial work by @Boden-C and then the overhaul of the mod I had to do for 1.20.5.

You can now name your shulker in the typical minecraft:grass_block convention to assign a permanent icon to it, even when empty. Helpfully, the anvil will show the new icon as soon as you've typed it correctly, so you won't waste any XP on incorrect names.

Boden-C commented 2 months ago

You can now name your shulker in the typical minecraft:grass_block convention to assign a permanent icon to it

If you used my code, it should match any custom name that contains all the words in the name (think it works with translated since I use the language name)

Specifically, it looks for the item name that has the most amount of matches in the custom name, disregarding plural, other than "shulker" and "bundle" so

Allowable Grass Block Grass Blocks Shulker of Grass Blocks Grass Block Shulker Box

NOT Allowable Grass - couldn't get this functionality as it would match Cobblestone in Cobblestone Stairs Wood - maybe you can add functionality for that but I didn't check any "categories"

BVengo commented 2 months ago

Locking since the original question has been handled. For discussion around implementation, please see #28