Started by
Soul of Cinder
on
Topic category: Help with Minecraft modding (Java Edition)
I've made a potion that make you get ignored by mobs but the problem is that i dont know how to make such procedure. i can take any kind of advice
Topic category: Help with Minecraft modding (Java Edition)
I've made a potion that make you get ignored by mobs but the problem is that i dont know how to make such procedure. i can take any kind of advice
with this plugin: https://mcreator.net/plugin/107323/new-procedures-plus you can use a procedure block that lets you make mobs stop targeting players (it's called set attack targeting of event/target entity to none)
i've made this but it still doesnt work, i think its because of the line about the zombie it seem i forgot smth but idk what(also thx for the pluggin)
if the image doesnt work i've put this: public class MobTargetNullProcedure {
public static void execute(Entity entity) {
if (entity == null)
return;
if (entity instanceof LivingEntity _livEnt0 && _livEnt0.hasEffect(AtaysModsModMobEffects.OBSCURITY.get())) {
if (entity instanceof Mob) {
if (entity instanceof Mob) {
try {
((Mob) entity).setTarget(null);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
}
}
on what trigger did you set that procedure?
i've made an effect and then i've put it on "on effect active tick"
I tried the same thing and it works
idk why it work with you but not with me, when we both did the same thing anyway at least thx for the help bro
You can go to entity Ai and add a condition procedure to target entities tagged as player. Then return false if player has effect obscurity. You can add that procedure to both the start condition and continue condition that way if a player gets the effect mid fight then the mob will not attack. This shouldnt interfere with the mob fighting back an attacking player just stop it from targeting players. If you dont want it to fight back against players with obscurity add the same procedure to the conditions for fight back attacker mobs in the Ai.