Started by
schizoidfromhell
on
Topic category: Help with Minecraft modding (Java Edition)
I want to make an item that, on use, lures mobs within a certain radius, i.e. 10 blocks, to you. i have no clue where to so much as start.
Topic category: Help with Minecraft modding (Java Edition)
I want to make an item that, on use, lures mobs within a certain radius, i.e. 10 blocks, to you. i have no clue where to so much as start.
The only reliable way I've found to micromanage entity pathfinding is with attack targets; you can override an entity's attack target to an entity, and make invisible entities with specific despawn conditions to set pathfinding to a specific location, or to reset an entity's hostility. In your case, you could make a procedure that, while holding the item, sets the attack targets of the desired entity type within a 10 block radius to the thing holding it. If the entities aren't hostile/neutral, that's probably fine, but if they are and you don't want them to attack the player, you could then create an invisible/hitboxless entity that despawns quickly, and set their attack target to this so they stop following the player. (You'd probably have to do this anyways to reset their pathfinding once the item is no longer in the player's hand.)