Detect Item Entity in Fluid

Started by Memebassador on

Topic category: Help with modding (Java Edition)

Last seen on 17:48, 18. Feb 2024
Joined Feb 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Detect Item Entity in Fluid

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:

  1. Removed the first if statement
  2. Changed the third if statement conditional to: Is (Get block at x: [x] y: [y] z: [z] the same block as [minecraft:water])
  3. 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])
  4. 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.

Last seen on 17:48, 18. Feb 2024
Joined Feb 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
A bit more testing and I am…
Sun, 02/11/2024 - 19:32

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?

Last seen on 19:34, 20. Apr 2024
Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
you can just use procedures…
Mon, 02/12/2024 - 01:51

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.

Last seen on 17:48, 18. Feb 2024
Joined Feb 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@maybemalicious there is no…
Tue, 02/13/2024 - 01:34

@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.