#(xn80a32) Is there a way to detect is dropped item on/in a certain block?

114 messages · Page 1 of 1 (latest)

carmine bobcat
#

Im new to denizen and i want to make a script, that will detect when a custom (dropped) ItemsAdder item hits certain block
For example: when player drops an item (from ItemsAdder ofc) and item hits water, it replaces with another item.
so is this possible or not?

fallen sorrelBOT
#

(xn80a32) Is there a way to detect is dropped item on/in a certain block?

fallen sorrelBOT
#

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.

neat zephyr
#

While there is an event for dropping an item, I don't think there is an event for it landing on a block.

I'm very unsure of entity steps on block will work for this, especially with water. You may need either a delta time event to check all dropped items in a world, or simply run a task when the item is dropped.

#

I'm unfamiliar of how to check itemsadder items.

#

I assume through NBT? We've had threads regarding this.

carmine bobcat
#

Thank you much, ill try this later

carmine bobcat
#

btw, how to check is cauldron full of water and how to manipulate its fullness?
Its my first script so i kinda dont know what to do and where to write ;d
I want to check is there any water in cauldron and if it is, then empty it by 1 and replace item in players hand

neat zephyr
#

Ehhh

#

Where did you pull javaitems from?

neat zephyr
neat zephyr
#

This isn't in the denizen meta?

carmine bobcat
#

;d idk

#

im new to denizen

neat zephyr
#

I'm very unfamiliar with this, a developer would have to verify any of this.

#

However.

#

Someone else has asked a similar question to get an itemsadder item.

carmine bobcat
#

item means original item that is replaced with itemsadder and itemsadder.id means javaitems:melted_copper_ingot?

lethal wadi
#

i've never heard of this, though

carmine bobcat
#

yeah

lethal wadi
#

no idea if they maintain it

#

If you want to see if you can get it working, you can try asking them

lethal wadi
#

but generally there's not a reason to just see if it's an itemsadder item, i wouldn't think

#

rather, you'd be doing that search as an inherent part of looking for a specific item

carmine bobcat
#

i think i will handle the item part, but how to check is cauldron full of water and how to manipulate its fullness?

lethal wadi
#

!t materialtag.level

weary saddleBOT
# lethal wadi !t materialtag.level

(Property) Returns the current level for a Levelled material, cake, beehives, snow, farmland, or brushable blocks.
"Levelled" materials include: water, lava, cauldrons, composters, light blocks, brushable blocks, and any other future Levelled implementing types.
For light blocks, this is the brightness of the light.
For water/lava this is the height of the liquid block.
For cauldrons, this is the amount of liquid contained.
For cake, this is the number of bites left.
For beehives/bee nests, this...

Group

Properties

Returns

ElementTag(Number)

Mechanism

MaterialTag.level

lethal wadi
#

iirc it actually changes the block material?

#

so there's a water_cauldron and lava_cauldron block?

carmine bobcat
#

prob

#

i think i quite dont understand something

#

ill change <player.item_in_hand.javaitems:melted_copper_ingot> if it wont work later

lethal wadi
#

!g tags

weary saddleBOT
# lethal wadi !g tags
Cannot Specify Searched GuidePage

Multiple possible guidepages: Your First Tags, Blurring The Line Between Commands And Tags: Procedure Scripts.

lethal wadi
#

!g first tags

weary saddleBOT
lethal wadi
#

materialtag is a placeholder

#

^ explained pretty well there

carmine bobcat
#

hmm

carmine bobcat
#

[00:42:13 INFO]: ERROR in script 'copper_transformation' in queue 'COPPER_TRANSFORMATION_23_MillRoad' while executing command 'IF' in file 'scripts/copper_transformation.dsc' on line '5' with player 'xn80a32'! Error Message: Invalid definition name 'paper'. [00:42:13 INFO]: Additional Error Info: Tag <[paper].raw_nbt.get[itemsadder].get[javaitems:melted_copper_ingot].after[string:]> is invalid! [00:42:13 INFO]: Additional Error Info: Unfilled or unrecognized sub-tag(s) '[paper].raw_nbt.get[itemsadder].get[javaitems:melted_copper_ingot].after[string:]' for tag <[paper].raw_nbt.get[itemsadder].get[javaitems:melted_copper_ingot].after[string:]>! [00:42:13 INFO]: Comparing if i@paper[display=Раскалённый медный слиток;custom_data=map@[itemsadder=map@[namespace=string:javaitems;id=string:melted_copper_ingot]];custom_model_data=10068;lore=li@Ингредиенты|;quantity=63] EQUALS [paper].raw_nbt.get[itemsadder].get[javaitems:melted_copper_ingot].after[string:] ... false [00:42:13 INFO]: No part of the if command passed, no block will run. [00:42:13 INFO]: Completing queue 'COPPER_TRANSFORMATION_23_MillRoad' in 3ms.

#

wait ama try smth

#

nah

#

Error Message: Invalid definition name 'paper'.

#

now im trying

    type: world
    events:
        after player right clicks water_cauldron:
        - if <player.item_in_hand> == <item[paper].raw_nbt.get[itemsadder].get[javaitems:melted_copper_ingot].after[string:]> && <context.block> == <material[water_cauldron].level> >= 1:
            - take iteminhand
            - give javaitems:melted_copper_ingot
            - narrate "it works"```
#

still isnt workin

neat zephyr
#

javaitems is not a real tag, as said.

#

I'm not sure how to give a itemsadder item.

carmine bobcat
#

a

#

wait

#

so it does check item successfully?

#

;d

#

no it doesnt

carmine bobcat
neat zephyr
#

Your logic operators are a bit wrong.

#

First of all.

carmine bobcat
#

a.

neat zephyr
#

context.block is just getting the location tag. And you're trying to equal it to a material level.

carmine bobcat
#

💀

neat zephyr
#

Just check it's materialtag.level and compare it to a number.

#

context.block.material.level

carmine bobcat
#

ah ok

#
    type: world
    events:
        after player right clicks water_cauldron:
        - if <player.item_in_hand> == <item[paper].with[display=Раскалённый медный слиток;custom_model_data=10068;raw_nbt=map@[itemsadder=map@[namespace=string:javaitems;id=string:melted_copper_ingot]]].raw_nbt.get[itemsadder].get[id].after[string:]> && <context.block.material.level> >= 1:
            - take iteminhand
            - give copper_block
            - narrate "it works"```
#

like that right

neat zephyr
#

I can't vouch for the item comparison check, the level looks correct.

carmine bobcat
#
[00:57:07 INFO]: Starting InstantQueue 'COPPER_TRANSFORMATION_41_HandyDiscover' with player 'xn80a32'... 
[00:57:07 INFO]: +- Queue 'COPPER_TRANSFORMATION_41_HandyDiscover' Executing: (line 5) if <player.item_in_hand> == <item[paper].with[display=Раскалённый медный 
                 слиток;custom_model_data=10068;raw_nbt=map@[itemsadder=map@[namespace=string:javaitems;id=string:melted_copper_ingot]]].raw_nbt.get[itemsadder].get[id].after[string:]> && <context.block.material.level> >= 1 ---------+ 
[00:57:07 INFO]: +> Executing 'IF': use_braces='true'   
[00:57:07 INFO]: Filled tag <player.item_in_hand> with 'i@paper[display = Раскалённый медный слиток; custom_data = map@[itemsadder = map@[namespace = string:javaitems; id = string:melted_copper_ingot]]; custom_model_data = 10068; lore = li@Ингредиенты|]'. 
[00:57:07 INFO]: Applying property 'display' on object of type 'ItemTag'... 
[00:57:07 INFO]: Applying property 'custom_model_data' on object of type 'ItemTag'... 
[00:57:07 INFO]: Applying property 'raw_nbt' on object of type 'ItemTag'... 
[00:57:07 INFO]: Filled tag <item[paper].with[display=Раскалённый медный слиток;custom_model_data=10068;raw_nbt=map@[itemsadder=map@[namespace=string:javaitems;id=string:melted_copper_ingot]]].raw_nbt.get[itemsadder].get[id].after[string:]> with 'melted_copper_ingot'. 
[00:57:07 INFO]: Comparing if i@paper[display=Раскалённый медный слиток;custom_data=map@[itemsadder=map@[namespace=string:javaitems;id=string:melted_copper_ingot]];custom_model_data=10068;lore=li@Ингредиенты|] EQUALS melted_copper_ingot ... false 
[00:57:07 INFO]: No part of the if command passed, no block will run. 
[00:57:07 INFO]: Completing queue 'COPPER_TRANSFORMATION_41_HandyDiscover' in 5ms.```
#

;d

neat zephyr
#

!debug

weary saddleBOT
# neat zephyr !debug
Info: debug

If you need help with a script issue, one of the most powerful tools Denizen has to offer is full debug output. This is displaying in your console whenever scripts are running until you turn debug off. To share a debug log quickly and easily with helpers, simply run the command /denizen debug -r in-game to begin recording, then run through the part of the script you need help with, then run the command /denizen submit. This will give you a link to a paste of the debug log, which you can then copy/paste back to us!

neat zephyr
#

Pasting from console makes it unreadable.

carmine bobcat
neat zephyr
weary saddleBOT
# neat zephyr !logcheck https://paste.denizenscript.com/View/126631
Server Version

Purpur version 1.20.6-2233-0d6766e (MC: 1.20.6)

Plugin Version(s)

Denizen: 1.3.1-SNAPSHOT (build 7067-DEV) -- (Current build :white_check_mark:)

Checked For

@neat zephyr

Online/Offline

Offline, but proxied.

UUID Version

3 (:triangular_flag_on_post: Offline)

Java Version

21.0.3 :white_check_mark:

Other Noteworthy Plugin(s)

MythicMobs: 5.7.0-SNAPSHOT-db9480c6, ProtocolLib: 5.3.0-SNAPSHOT-726

Possibly Relevant Plugin(s)

TAB: 4.1.5 - This plugin adds Below_Name scoreboards to NPCs.
ViaVersion: 5.0.3 - Mixed client vs server versions can sometimes cause packet-related issues.
ModelEngine: R4.0.7 - 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.

neat zephyr
#

I see a few problems.

carmine bobcat
#

m

neat zephyr
#

Give me a bit.

carmine bobcat
#
    type: world
    events:
        after player right clicks water_cauldron:
        - if <player.item_in_hand> == <item[paper].with[display=Раскалённый медный слиток;custom_model_data=10068;raw_nbt=map@[itemsadder=map@[namespace=string:javaitems;id=string:melted_copper_ingot]]].custom_data.get[itemsadder].get[id].after[string:]> && <context.block.material.level> >= 1:
            - take iteminhand
            - give copper_block
            - narrate "it works"```
#

not working ;d

neat zephyr
#

Unfortunately, a helper must address this.

carmine bobcat
#

somehow itemsadder now succesfully hooked into denizen

#

BUT

#

I AM

#

STUPID ASS

#

[02:20:24 INFO]: Comparing if javaitems:melted_copper_ingot EQUALS javaitems:melted_copper_ingot ... true

#

nothing new there

#

just did - if <player.item_in_hand.ia_namespaced_id> == javaitems:melted_copper_ingot

#

all time i was trying to put javaitems:melted_copper_ingot into <player.item_in_hand.ia_namespaced_id>

#

i was wrong

#

<player.item_in_hand.ia_namespaced_id> gives an ID of an item

#

so u have to compare it to ur id using if

#

now it's doing good

#

but still something is wrong with <context.block.material.level> >= 1:

neat zephyr
#

Unfortunately, I cannot continue until a helper address some problems.

carmine bobcat
#

just for u know i bought minecraft

#

if you saw that server is offline doesn't mean that i support piracy/don't have license for minecraft

#

if you need i can prove.

#

nah man that is harassing

#

this is just a test server, i have a minecraft license both on mobile devices, on my old PS 3, and on my computer

weary saddleBOT
# carmine bobcat !logcheck https://paste.denizenscript.com/View/126636
Server Version

Purpur version 1.20.6-2233-0d6766e (MC: 1.20.6)

Plugin Version(s)

Denizen: 1.3.1-SNAPSHOT (build 7067-DEV) -- (Current build :white_check_mark:)

Checked For

@carmine bobcat

UUID Version

3 (:triangular_flag_on_post: Offline)

Java Version

21.0.3 :white_check_mark:

Other Noteworthy Plugin(s)

MythicMobs: 5.7.0-SNAPSHOT-db9480c6, ProtocolLib: 5.3.0-SNAPSHOT-726

Possibly Relevant Plugin(s)

TAB: 4.1.5 - This plugin adds Below_Name scoreboards to NPCs.
ViaVersion: 5.0.3 - Mixed client vs server versions can sometimes cause packet-related issues.
ModelEngine: R4.0.7 - 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.

carmine bobcat
#

unfair

worn spireBOT
#
Resolved

Thread closed as resolved.

last crane
#

@stable swallow cracked @carmine bobcat

worn spireBOT
#
Thread Reopened

Thread was manually reopened by @last crane.

stable swallowBOT