Data Packs Other

Bhex's Over-Named Extension Engine for Custom Items

  • Functions
  • Loot Tables
  • 1,136 views • 1 today
  • 40 downloads • 0 today
  • 9
  • 7
  • 4
MyNameIsBhex
Level 49 : Master Technomancer Scribe
79
Bhex's Over-Named Extension Engine for Custom Items!
Last year I released the BONE Engine for Custom Blocks, and around the same time I started working on a BONE Engine for Custom Items. At the time, this was much harder to do as a readable Engine, but luckily 1.20.5 has made my job a lot easier.

This is a datapack for nerds, so I'm gonna make this digestible for them and not worry about keeping things simple.

You can use any item as a Custom Item, but I like to use Spawn Eggs as they are never used in Survival Mode and can be specified in Crafting Recipes, and this is what the datapack was specifically made for. You could even use blocks with CustomModelData as Custom Items. I recommend using Items that are not used in any recipes.
This works by giving the Player an Item with a specific CanBreak tag which includes every block in Minecraft. The datapack detects Survival Players holding an item with this tag and puts them in Adventure Mode so they cannot use the item, but can still break blocks. You can also specify CanPlaceOn tags to determine what block the Item can be placed on. When the Player is not holding the Item, they are put back in Survival. Players in Creative or Adventure Mode will stay in their respective gamemodes.

This is fully compatible with custom right-click detection using Eat Seconds.

Included in the Pack is a Loot table with an example item. No example resources, you can make your own.
Command for the example item is: "/loot give @s loot bone_ci:example". It's just a stone block that you can't place down. Kinda the point of the Engine.

This also works if you just want to give Players un-placeable blocks for some reason.

Feel free to optimize it bro this is a bare BONEs engine :D

If u use this pls credit me. LMK if you have any issues. Join my Discord
CompatibilityMinecraft 1.20
toMinecraft 1.21
Tags
Curated in their collections

  Have something to say?

MonkeManII
10/17/2024 3:54 pm
He/Him • Level 35 : Artisan Procrastinator Nerd
found this through the Chopping Block skyblock datapack thing, and I have to say: this is genius!

what I do for custom items is I do a structure block with custom_model_data and custom_data, and I have a custom "heavy workbench" (read: renamed barrel with a item display over it) that checks for certain items (which can also check for data).



so, i'll have a "steel_ingot" that's a structure_block[custom_data={id"steel_ingot"}] and check for the id tag
definitely not the most efficient, but oh well.

also for custom blocks I do the stupid and overly complicated solution of raycasts (instead of just using a spawn egg) because I forgot you can do that.

anyways, this is so much simpler! love it!
1
MyNameIsBhex
11/08/2024 5:40 pm
He/Him • Level 49 : Master Technomancer Scribe
Cool thing is, you can use these items in custom recipes too. With your Structure Block method, all the custom items are interchangeable in the Vanilla Crafting Table
2
MonkeManII
11/09/2024 12:33 pm
He/Him • Level 35 : Artisan Procrastinator Nerd
Yeah... solution to that is to make your own crafting UI, which I had to do :\


The reason I do it in such a weird way is for compatibility with other datapacks.
Like if a datapack had a really cheap item that's assigned to jigsaws, and it's used with a datapack that assigns a really expensive item to jigsaws, those would be interchangable, and extremely cheaty. Also, there's ~6 custom items that can be used in custom recipes (unless I missed some)

(command block, repeating command block, chain command block, structure block, jigsaw)

Anyways, your solution works great when used in a modpack-style datapack, I'm just salty that I didnt think of it first :)
1
MyNameIsBhex
11/11/2024 12:18 am
He/Him • Level 49 : Master Technomancer Scribe
Oh yeah I was doing custom crafting tables until very recently, too lmao. If you think what exists now is genius, you should have seen the first version of it(which I made infuriatingly late, as it was made obsolete within a few updates using datapack technology that's existed since 1.13)
The first version entirely re-modeled the Spawn Eggs instead of giving them a Model component, and had any custom recipes just output a spawn egg with no NBT. But then, if the datapack found a Survival Player with that specific Spawn Egg in their inventory, it would change it to the custom item with NBT. Using that, you could make basically seamless custom NBT crafting. Almost impossible to differentiate from Vanilla
1

Welcome