Posted October 18, 20186 yr How would i go about setting a variable on a specific entity and retrieve it later? FE: @SubscribeEvent public void entitySpawned(EntityJoinWorldEvent event) { Entity entity = event.getEntity(); entity.setVariable("variableName",value); //set the variable } @SubscribeEvent public void onHurt(LivingHurtEvent event) { Entity entity = event.getEntity(); if (!entity.getVariable("variableName")) return; //check the variable }
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.