#How to make an item return a glass bottle when consumed either by the player or by a recipe

20 messages · Page 1 of 1 (latest)

quasi scaffold
#

I have some custom drinkables set up as written below

event.create('white_wine').displayName('Bottle of White Wine')
        .food(food => {
            food
                .alwaysEdible()
                .effect('nausea', 600, 0, 0.2)
                .effect('absorption', 2400, 1, 1)
        })
        .useAnimation("drink")
        .unstackable()

How do I make it return a glass bottle when used in any recipe? Also when drank by the player?

knotty agateBOT
#

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

muted thorn
#

add this to a recipe

.modifyIngredient('kubejs:white_wine', 'empty_bottle')

you have to double check the empty bottle ID, i dont know it off the top of my head

edgy terrace
#

this for your item registry:

event
    .create("white_wine")
    .displayName("Bottle of White Wine")
    .food((food) => {
      food
        .alwaysEdible()
        .effect("nausea", 600, 0, 0.2)
        .effect("absorption", 2400, 1, 1)
        .eaten((ctx)=> {
          ctx.player.give('minecraft:glass_bottle');
        });
    })
    .useAnimation("drink")
    .unstackable();
muted thorn
#

oh i forgot about that part

#

xd

quasi scaffold
muted thorn
#

it should, yeah

quasi scaffold
#
    e.replaceInput({input: '#kubejs:any_effect'}, '#kubejs:any_effect', '#kubejs:any_effect'.modifyIngredient('#kubejs:any_effect', 'empty_bottle'))
    e.replaceInput({input: '#kubejs:white_effect'}, '#kubejs:white_effect', '#kubejs:white_effect'.modifyIngredient('#kubejs:white_effect', 'empty_bottle'))
    e.replaceInput({input: '#kubejs:red_effect'}, '#kubejs:red_effect', '#kubejs:red_effect'.modifyIngredient('#kubejs:red_effect', 'empty_bottle'))

is this correct?

muted thorn
#

no, thats not even valid code SCkittydead

#

you put it at the end of a recipe

#
e.shapeless(output, input).modifyIngredient('#kubejs:any_effect', 'empty_bottle')
quasi scaffold
#

so i cant just modify every recipe that uses it?

muted thorn
#

you have to remake the recipes, dont think you can modify them

quasi scaffold
#

i like how that emoji is from a cat server and labeled as such but thats a sable

#

also that sucks

peak thunder
muted thorn
#

couldve been :o

#

i dont remember 100% very_sad_kitty_lex

devout dove