#Custom flower not shown properly in creative menu
1 messages · Page 1 of 1 (latest)
Remove collision True in your block code and modify the selection box.
If your flower is 8x12x8 set the selection box origin to -4 12 -4
It will center the hit box and will be exactly the size of your flower
I will past you the exact code when home is you don't see what I mean
The origin is minus half the size of your texture if you have other flower sizes
Add this to your code so that flowers can only be placed on grass and dirt
"minecraft:placement_filter":{
"conditions": [
{
"allowed_faces": ["up"],
"block_filter": ["grass", "dirt"]
}
]
}
If you want it to behave like a minecraft flower , you can add on_interact component that detect bonemeal and trigger an event to run the command loot. You create a custom loot table for your block and you are good.
The component:
"minecraft:on_interact": { "event": "givemore", "condition": "query.get_equipped_item_name=='bone_meal'" }
The event:
`"events": {
"givemore": {
"run_command": {
"command": [
"loot spawn ~ ~ ~ loot \"blocks/my_beautiful_flower_loot_table\""
]
}
}
}`
Create a folder loot_tables in your BP and another folder called blocks inside it, and create a new file called my_beautiful_flower_loot_table.json(same name specified in the event)
Open it and you past this:
{ "pools": [ { "rolls": 1, "entries": [ { "type": "item", "name": "your_item_identifier", "weight": 1, "functions": [ { "function": "set_count", "count": { "min": 1, "max": 4 } } ] } ] } ] }
For your main problem :
Open your block file in your BP with a text editor. I suggest notepad++
Find the line :
"minecraft:selection_box": true,
And replace this line with this code:
"minecraft:selection_box": { "origin": [-3, 0, -3], "size": [6, 8, 6] },
In y case my flower texture is 6 blocks wide and 8 blocks tall(open your texture in photo editor to know exactly the size of your flower).
You can see I have set this in the size parameters.
For the origin part, you just need to do a basic calculation. Y should always stay 0 as your flower is on the ground.
For X and Z you divide your flower texture size by 2 and add minus sign in front.
(for me it's 6 then I have set the origin for both X and Z to -3
Thanks, looks like it works as I want now
And thank you too, it works now
Do you know how can I make it so it only shows the texture, and not the block form in inventory?
I think it shows the block form in the inventory (or the texture just looks smaller lol)
Even minecraft flowers or items are displayed the same way(small when the texture is small)
But it's just the same thing with the blue orchid and my item looks different than that
You would need to recreate another version of your texture, bigger and use attachable but it doesn't worth it imo
Well tbh I would want it to look like vanilla ones 
Oh you are right lol, I have made exactly 96 customs flowers the last week and not even noticzd that minecraft is cheating lol.
I just noticed something else proving they use a system we don't have access:
Their flower texture in inventory are touching the bottom. Not ours even if our texture are done at y 0
For each of your flower blocks make sure the option "register_to_creative_menu" is set to false in your behavior pack. Then you make an item file for each of your custom flowers and use the "minecraft:icon" component using your flower's texture. Your flowers will now display correctly in your inventory.
I wanna bump this up because I'm making some other flowers now.
This doesn't work ^
"minecraft:icon": "textures/blocks/poinsettia",```
Says these are not valid
By the way, this is the problem I'm having. I forgot to mention. Do not get confused by the post message.