use of net.minecraft.scoreboard.ScoreCriteria in project takumicraft by TNTModders.
the class TakumiEvents method onPlayerUpdate.
@SubscribeEvent
public void onPlayerUpdate(LivingUpdateEvent event) {
if (TakumiConfigCore.useTP && event.getEntityLiving() instanceof EntityPlayer) {
Scoreboard scoreboard = event.getEntityLiving().world.getScoreboard();
ScoreObjective objective = scoreboard.getObjective("tp") == null ? scoreboard.addScoreObjective("tp", new ScoreCriteria("tp_crit")) : scoreboard.getObjective("tp");
Score score = scoreboard.getOrCreateScore(event.getEntityLiving().getName(), objective);
scoreboard.setObjectiveInDisplaySlot(1, objective);
}
}
Aggregations