Started by
Memebassador
on
Topic category: Help with Minecraft modding (Java Edition)
Some other attempts at this here: https://mcreator.net/forum/78253/how-check-if-gem-touches-water
and here: https://mcreator.net/forum/55250/transform-item-when-thrown-water
Basically, why doesn't this "code" work:
Event trigger - triggered by external call or when (global trigger): [On loaded entity tick update] {
If (Is [Event/target entity] (sub)type of [Item]) Do {
Execute command / "[say Pass 1]" at x: [x] y: [y] z: [z]
If (Is (Convert item entity [Event/target entity] to itemstack) tagged in item tags as "[minecraft:gems]") Do {
Execute command / "[say Pass 2]" at x: [x] y: [y] z: [z]
If (Is [Event/target entity] in water or bubble column) Do {
Execute command / "[say Pass 2]" at x: [x] y: [y] z: [z]
}
}
}
}
Things I have tried:
- Removed the first if statement
- Changed the third if statement conditional to: Is (Get block at x: [x] y: [y] z: [z] the same block as [minecraft:water])
- Changed the third if statement conditional to: Is (Get fluid as block at x: [x] y: [y] z: [z] the same block as [minecraft:water])
- Changed the item tag: "[minecraft:gems]" has been numerous different tags tested against numerous items, and none work
The commands in each if statement are supposed to tell me in game chat (I know I can do it in console as well) if the if statement conditional was successful - I have never gotten any one of the commands to actually execute in-game. Any help is appreciated.
A bit more testing and I am pretty sure the problem is this: This fails to detect dropped items as entities. If I change the (sub)type field in the first if statement conditional to any other entity, e.g. an Allay, it works. Am I unable to detect dropped item entities, or is this a bug?
you can just use procedures to check the entity type and what kind of item it is, no need for custom elements. You could then simply damage the entity if it's the item (which kills it and deletes the item) before then spawning the new item in the same block.
@maybemalicious there is no custom element. The code I wrote above is simply MCreator blocks written in a way that makes me not need to screenshot. My problem is that I am doing what you are saying, and that is not working.