Topic category: Advanced modding
Hello. I need help, I made the code, rendering the entity. And I have a problem, how to make this code work only for a player whose scoreboard, for example, name = 1 ? I tried to do it, but there are always a bunch of errors. I correct 1, another one appears:( I will be very grateful if you help. ( version 1.12.2 )
(everything is imported here)
@ElementsTestMod.ModElement.Tag
public class ProcedureGgg extends ElementsTestMod.ModElement {
public ProcedureGgg(ElementsTestMod instance) {
super(instance, 78);
}
public static void executeProcedure(Map<String, Object> dependencies) {
if (dependencies.get("entity") == null) {
System.err.println("Failed to load dependency entity for procedure Ggg!");
return;
}
Entity entity = (Entity) dependencies.get("entity");
if ((entity instanceof EntityPig)) {
if (entity instanceof EntityPlayer) {
}
}
}
@SubscribeEvent
public void onEntityRenderPre(RenderLivingEvent.Pre event) {
if (event != null && event.getEntity() != null) {
Entity entity = event.getEntity();
GL11.glDisable(GL11.GL_DEPTH_TEST);
java.util.HashMap<String, Object> dependencies = new java.util.HashMap<>();
this.executeProcedure(dependencies);
}
}
@SubscribeEvent
public void onEntityRenderPost(RenderLivingEvent.Post event) {
if (event != null && event.getEntity() != null) {
Entity entity = event.getEntity();
GL11.glEnable(GL11.GL_DEPTH_TEST);
java.util.HashMap<String, Object> dependencies = new java.util.HashMap<>();
this.executeProcedure(dependencies);
}
}
@Override
public void preInit(FMLPreInitializationEvent event) {
MinecraftForge.EVENT_BUS.register(this);
}
}