#(snozbear) on recipe formed

77 messages · Page 1 of 1 (latest)

mystic stag
#

Heya, I'm having a bit of trouble with the on recipe formed event.

Basically I have this

        #iron tools
        on iron_shovel recipe formed:
        - define output <item[<server.flag[divinity.crude_iron_shovel]>]>
        - determine <[output]>```

which works fine, however the iron_shovel recipe formed event is being triggered for recipes that aren't iron shovels? 

I've attached an image but the event is being triggered for a bronze_ingot, which is supplied by Nexo, but its base item is paper so I'm wondering why its triggering the event at all
safe plazaBOT
#

(snozbear) on recipe formed

safe plazaBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.

mystic stag
#

It doesn't trigger for normal paper and I have other nexo “ingots” that are functionally dental but a different name, but heres a debug thingy
https://paste.denizenscript.com/View/134912

void thorn
red novaBOT
# void thorn !logcheck https://paste.denizenscript.com/View/134912
Server Version

Paper version 1.21.3-82-5a60ffb (MC: 1.21.3)

Plugin Version(s)

Citizens: 2.0.36-SNAPSHOT (build 3644) -- (:warning:Outdated build, behind by 207)
Denizen: 1.3.1-SNAPSHOT (build 7103-DEV) -- (:warning:Outdated build, behind by 93)
Depenizen: 2.1.1 (build Unknown)
Sentinel: 2.9.2-SNAPSHOT (build 528) -- (Current build :white_check_mark:)
dDiscordBot: 0.7 (build 303) -- (Outdated build, behind by 2)

Checked For

@void thorn

UUID Version

4 (:white_check_mark: Online)

Java Version

21.0.2 :white_check_mark:

Other Noteworthy Plugin(s)

WorldGuard: 7.0.13-beta-1+2f13ae0, MythicMobs: 5.10.0-SNAPSHOT-67bb6704, ProtocolLib: 5.3.0

Possibly Relevant Plugin(s)

TAB: 5.0.3 - This plugin adds Below_Name scoreboards to NPCs.
ModelEngine: R4.0.8 - ModelEngine has Citizens support, but that support is known to be buggy. Issues related to NPCs that use ModelEngine should be reported to ModelEngine support, not Citizens.
GSit: 2.3.2 - 'Sit on other players' or 'sit on mobs' plugins sometimes allow players to sit on NPCs.

mystic stag
#

it might be that it’s quite old, but we’re on 1.21.3 still

void thorn
#

It might.

#

Have you considered 1.21.4? That's the latest stable ModelEngine supports.

mystic stag
#

Yes, I was planning on updating soonish but the real limitation is fabled/skillapi because they tend to break

void thorn
#

You're also slightly behind.

#

Just to be safe.

#

!e item recipe formed

red novaBOT
# void thorn !e item recipe formed
Group

Item

Event Lines

<item> recipe formed

Triggers

when an item's recipe is correctly formed.

Has Player

Always. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.

Context

<context.inventory> returns the InventoryTag of the crafting inventory.
<context.item> returns the ItemTag to be formed in the result slot.
<context.recipe> returns a ListTag of ItemTags in the recipe.
<context.recipe_id> returns the ID of the recipe that was formed.
<context.is_repair> returns an ElementTag(Boolean) of whether the event was triggered by a tool re...

Determine

ItemTag to change the item that is formed in the result slot.

Cancellable

True - this adds <context.cancelled> and determines cancelled + cancelled:false.

void thorn
#

Hmmm.

#

Define the context.recipe for me, and then run another debug?

#

Preferably, for the correct recipe, and the incorrect recipe (bronze bar)

#

Also, you're using an unknown version of depenizen.

#

Why?

mystic stag
#

I can do that in a sec, and it’s unknown because I updated skillapi —> fabled for myself

mystic stag
#

Updating seems to have fixed it 🥴 Many such cases

Ty though, I thought we were on the last one for 1.21.3

Just as an add-on, do you know if something like this is possible for recipes (this doesn't work obvs, just an example of what I'm trying to achieve)

    type: item
    material: poisonous_potato
    recipes:
        1:
            type: shaped
            input:
            - air|<server.flag[nexo.bronze_ingot]>|air
            - air|stick|air
            - air|stick|air```
void thorn
#

w!tias

#

!tias

red novaBOT
# void thorn !tias
Info: tias

Try it and see!

If somebody pulled this up for you, you're probably asking a question of the public channel that's easier and faster to figure out by just attempting your idea in-game and looking at the result of that attempt.

mystic stag
#

It doesn't seem to, which is why I was wondering if there was another way to achieve it

void thorn
#

Can you do a proper debug for that?

mystic stag
#

Sure, its just on reload though - ignore the interact_baby thing, that was me messing around
https://paste.denizenscript.com/View/134914

#

I did try <item[<server.flag[nexo.bronze_ingot]>]> just in case

mystic stag
#

I recently updated to 1.21.7 and the denizen for this version but I still can't seem to get this to work

mystic stag
#

interestingly it works if I use the most recent purpur build? but a lot of other plugins just won't load on 1.21.8 🥴

tardy muralBOT
mystic stag
#

wow

ocean schooner
#

i mean, 1.21.7 isn't supported anymore

#

if it works on .8, then great, but we won't spend time looking into why it doesn't work on .7

mystic stag
#

I thought there wasn't much difference between .7 and .8 though

lyric bear
#

Does it work on Paper? that's what we officially support (and would need to fix for if it doesn't work on)

ocean schooner
#

@mystic stag ^

mystic stag
#

I haven’t been able to check sorry, been caught up with some health stuff but I’ll let you know

mystic stag
#

Seems to work, though the first time I changed to paper it didn't but after like 5 restarts it seems fine on paper

warped questBOT
#
Resolved

Thread closed as resolved.

mystic stag
#

Ah, so it works sorta but not entirely? It works for some items but not all.

I made two recipes one with a flagged arm_chair and the other with the bronze_ingot but only the arm_chair one seems to work

https://paste.denizenscript.com/View/135421

warped questBOT
#
Thread Reopened

Thread was manually reopened by @mystic stag.

#
Changed to Help/Support

Thread is now a Help/Support thread. A helper will check your thread when available.

lyric bear
#

You have a lot of plugins there, can you replicate the issue on a clean test server to make sure it isn't a plugin conflict?

mystic stag
#

Shore gimme a sec

#

I also gave myself both the items just to double check, and these are the recipes I've created and only the arm_chair one works:

https://paste.denizenscript.com/View/135423

edit: I thought it might be the long ----------- lines or the hexcode in the lore but I removed them and same outcome

visual burrow
#

Try reducing your item further to minimal mechanisms, and keep adding until it borks.

mystic stag
#

Its pretty bare as it is, but it seems to work if the lore is removed entirely which isn't ideal

#

^^ doesnt work
but this one does

mystic stag
#

should I make another thread btw? I feel like this has drifted from the original topic

mystic stag
#

Heya, anyone have any ideas on how to fix this

lyric bear
#

For the item that doesn't work, can you give yourself the item from the server flag and compare it to the item that doesn't work in the craft? The most realistic explanations is that the plugin modifies it's items somehow

#

If you can't find a difference, can also /paper dumpitem while holding them to get their exact data.

mystic stag
#

Sure, I’ll give it a go and send over the dump item in a sec - though I tried it a while ago and they were still able to stack

mystic stag
#

Okay, I must've messed up when I said they stacked because they don't - but like you said they're different 🥴

Not sure how I'd fix it though
https://paste.denizenscript.com/View/135500

visual burrow
#

Approaching it from a different direction, what is preventing you from making item container scripts?

#

If you even want to rely on the event. You could make your own crafting system, checking where items are, and see if that matches an item recipe.

#

The latter will afford you greater amount of flexibility., i.e. do you need to compare a full item, or only check for an itemname/scriptname?

mystic stag
# visual burrow The latter will afford you greater amount of flexibility., i.e. do you need to c...

I would but the reason I'm doing it this way is to be able to use nexo and divinity items lmao - its beyond convoluted but the idea is to have a recipe via denizen which uses the nexo ingot, but when that recipe is formed it replaces the outcome with a divinity item.

if the nexo ingots were only used this way then I would create them via denizen, but they're used in a bunch of other plugins that just have bridges to nexo

mystic stag
#

don’t you sob react me lmao

lyric bear
#

Exact item matching like that is generally not super reliable, as it'd break if the item is renamed, has a durability change, etc.

#

I would use a material matcher and check the input items directly in a recipe formed event

#

!t custom_data

red novaBOT
# lyric bear !t custom_data

(Property) Returns an item's custom NBT data, if any.
The map is in NBT format, see !language Raw NBT Encoding.
This does not include any normal vanilla data (enchantments, lore, etc.), just extra custom data.
This is useful for integrating with items from external systems (such as custom items from plugins), but item flags should be preferred otherwise.

Group

Properties

Returns

MapTag

Mechanism

ItemTag.custom_data

Examples
# Use to check if an item has custom data from another plugin.
- if <[item].custom_data.get[external_plugin_data].if_null[null]> == external_custom_item:
  - narrate "You are using an item from an external plugin!"
mystic stag
#

I'll give that a go but I'm not sure worried about the item changing since we have a lot of that stuff disabled for that reason (other plugins are a bit touchy) - maybe I'll just have it check the nexo id or something

lyric bear
#

Yes exactly - recipe takes in material, event checks id in custom data

mystic stag
#

hrm, it doesn't seem to think that the item is actually paper anymore but checking the .material does still spit out paper

https://paste.denizenscript.com/View/135510

lyric bear
#

!l item script containers

red novaBOT
# lyric bear !l item script containers

Item script containers are an easy way to pre-define custom items for use within scripts. Item
scripts work with the ItemTag object, and can be fetched with the Object Fetcher by using the
ItemTag constructor ItemTag_script_name. Example: - drop <player.location> super_dooper_diamond

The following is the format for the container. Except for the 'material' key (and the dScript
required 'type' key), all other keys are optional.


# The name of the item script is the same name that you can use to construct a new
# ItemTag based on this item script. For example, an item script named 'sword_of_swiftness'
# can be referred to as simply 'sword_of_swiftness'.
Item_Script_Name:

    type: item

    # Must be a valid ItemTag. See 'ItemTag' for more information.
    # | All item scripts MUST h

...

Group

Script Container System

lyric bear
#
# You must specify the input for the recipe. The below is a sample of a 3x3 shaped recipe. Other recipe types have a different format.
# You are allowed to have non-3x3 shapes (can be any value 1-3 x 1-3, so for example 1x3, 2x1, and 2x2 are fine).
# For an empty slot, use "air".
# By default, items require an exact match. For a material-based match, use the format "material:MaterialNameHere" like "material:stick".
# To make multiple different items match for any slot, just separate them with slashes, like "stick/stone".
# To match multiple materials, use "material:a/b/c".
# You can also make a dynamic matcher using '*', like "material:*_log" to match any log block,
# or 'test_*' to match any item script that has name starting with 'test_'.
# Note that to require multiple of an item as an input, the only option is to use multiple slots.
# A single slot cannot require a quantity of items, as that is not part of the minecraft recipe system.
mystic stag
#

oh duh, sorry my bad, shouldn't do things while eepy - that seems to work for now, tysm 🙏🏻