#How to make a Custom Item with Loot-Table

1 messages · Page 1 of 1 (latest)

forest shore
#

Hi I would like to add a custom item with KubeJS & LootJs which is a loottable with a pool of items that have x% chance of coming out when you right click with the new item.
The result should automatically appear in the player's inventory and, if possible, a message in the chat or as a small display of what you have gotten.
The custom item should also disappear after use or the stack should count down if you have several of them.

Is this even possible or do you need a block for this?

The item to be used already exists, just no texture for it yet.
If so, maybe someone could help me.

E.g. You have item x, which you use by right-clicking and then item d and c are added to the inventory (if space is available, if not dropped), then the chat message or a small fade-in appears and item x disappears or is counted down.

StartupEvents.registry('item', event => {
event.create("essence")
        .displayName("Essence");
});

This is code for the item register event.

trail gustBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

red whale
#

did you ever find out if its possible to do this? I'm trying to add a lootbag item and this is pretty much exactly what I wanted to do

forest shore
#

yes it was a hard way to find out how i must do it

#

i can share my code how i have done it in a few days

red whale
#

did it use the runCommandSilent function? I've literally just figured out how to do it with that, but if theres a way that doesn't need commands I'd love to use that instead

forest shore
#

it is using runCommandSilent

forest shore
#

without any commands i think you need to make a mod for it