How Do I Right Click On Mobs

Started by yelfog on

Topic category: Help with modding (Java Edition)

Last seen on 03:11, 29. Apr 2022
Joined Apr 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How Do I Right Click On Mobs

So I put together a procedure that is supposed to open a gui when I right click on a spider. The problem is I cant right click on mobs while in game. Is there a easy solutution to this?

"my procedure"

Last seen on 03:11, 29. Apr 2022
Joined Apr 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I If the image isn't showing…
Fri, 04/08/2022 - 21:55

I If the image isn't showing up here is the link for it

https://ibb.co/zXpFKs9

Last seen on 08:09, 24. Apr 2024
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Change is source entity to…
Fri, 04/08/2022 - 22:40

Change is source entity to entity. The Player is the source entity (who is right clicking), the entity is the splider (who receives the right click).Same with deal <###> damage to source entity, change it to entity.

Last seen on 22:10, 29. Mar 2024
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Wow, Really Thanks, I Also…
Wed, 10/25/2023 - 04:51

Wow, Really Thanks, I Also Had The Same Problem and You We're Right I Swapped Them and It Worked

Last seen on 11:58, 25. Apr 2024
Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
# Trigger an external call…
Wed, 10/25/2023 - 07:25

# Trigger an external call or when a player right-clicks on an entity
Events trigger - triggered external call
Or when (global trigger) player right-clicks on entity:

# Check if the source is a sub-type of a spider
If source is (sub)type of spider:
 # Open the "normalspiderGui" screen for the targeted entity at coordinates (x, y, z)
 Do open screen events/target entity x y z gui normalspiderGui
 
 # Check if there are items in slot 0 of the "currency" GUI in the targeted entity
 If get number of items from slot 0 of the currency > 0:
   # Deal 100 damage to the source entity with the generic type
   Deal 100 damage to source entity type generic
   
   # Spawn a "custom spiderwithsadle" living entity at coordinates (x, y, z)
   Spawn x y z living entity custom spiderwithsadle
   
   # Close any open GUI for the targeted entity
   Close any GUI open for events/target entity
   
   # Open the "spiderwithsadle" screen for the targeted entity at coordinates (x, y, z)
   Open screen for events/target entity, passing location x y z, GUI spiderwithsadle