How do I make an entity rideable only when tamed?

Started by Finemanederby on

Topic category: Help with Minecraft modding (Java Edition)

Joined Apr 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I make an entity rideable only when tamed?

Does anyone have any ideas on how I can make an entity rideable only after the player has tamed it? If this is completely impossible then a mount condition should be added for things like this as well as to enhance the already lacking entity customizability freedom.

Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If u want to make an entity…
Fri, 07/28/2023 - 10:36

If u want to make an entity only ride when its tamed by the person that is clicking and kick out who is not the owner, you need all this, idk if realy works but if yes, tell me because I have made the same and didn't tested the kick the other players procedure in multiplayer...
create entity and make rideable, controls for forward and strafe are optional, u need to make a new trigger "when right clicked on entity" this trigger is to verify the owner and make him ride...
Create a forge tag named forge:tamed_entities
create a global procedure with "Player Right Clicks on Entity"

Images:
https://drive.google.com/drive/folders/10yDFJxw70Ezlt-brl5Rgn5lr53xF0HqU?usp=drive_link

Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
if you need help, i have a…
Fri, 07/28/2023 - 20:55

if you need help, i have a solution :3
the way to do this is making a procedure with the global variable "player right clicks on entity". the easiest way i can explain the actual procedure would be in this code block. let me know if you have any more questions!

if ([event/target entity] (sub)type of [your mob])
	if (item in main hand of [source entity] = [the item you're taming it with])
		if [source entity] is *not* in creative
		   set item in main hand of [source entity] to [get number of items - 1] 
		   															[item in main hand of source entity]
		   															
		   // as there is a 33% chance for the mob to be tamed after each right click, add this															
		   if (random [0,1) < 0.33)
		   tame [event/target entity] by [source entity]
	else
		make [source entity] ride [event/target entity]
		if [event/target entity] is *not* tamed
		make [source entity] stop riding entity
		
		// the x, y, z can be whatever you want
		set location of [source entity] to x, y, z