Updated setting of custom names on custom entities for Spigot 1.19.

This commit is contained in:
David Berdik 2022-06-14 19:19:06 -04:00
parent 36ed006f89
commit 59e815e5ba
2 changed files with 5 additions and 5 deletions

View File

@ -9,7 +9,7 @@ import java.util.Random;
import org.bukkit.Color;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.network.chat.Component;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.ai.attributes.Attributes;
@ -38,7 +38,7 @@ public class CustomSkeleton extends net.minecraft.world.entity.monster.Skeleton
this.getAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(Herobrine.getPluginCore().getConfigDB().npc.getDouble("npc.Demon.Speed"));
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(Herobrine.getPluginCore().getConfigDB().npc.getInt("npc.Demon.HP"));
this.setHealth(Herobrine.getPluginCore().getConfigDB().npc.getInt("npc.Demon.HP"));
this.setCustomName(new TextComponent("Demon"));
this.setCustomName(Component.literal("Demon"));
Skeleton entityCast = (Skeleton) this.getBukkitEntity();

View File

@ -7,7 +7,7 @@ import org.bukkit.Material;
import org.bukkit.entity.Zombie;
import org.bukkit.inventory.ItemStack;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.network.chat.Component;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.ai.attributes.Attributes;
@ -38,7 +38,7 @@ public class CustomZombie extends net.minecraft.world.entity.monster.Zombie impl
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(Herobrine.getPluginCore().getConfigDB().npc.getInt("npc.Guardian.HP"));
this.setHealth(Herobrine.getPluginCore().getConfigDB().npc.getInt("npc.Guardian.HP"));
this.setCustomName(new TextComponent("Artifact Guardian"));
this.setCustomName(Component.literal("Artifact Guardian"));
Zombie entityCast = (Zombie) this.getBukkitEntity();
@ -58,7 +58,7 @@ public class CustomZombie extends net.minecraft.world.entity.monster.Zombie impl
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(Herobrine.getPluginCore().getConfigDB().npc.getInt("npc.Warrior.HP"));
this.setHealth(Herobrine.getPluginCore().getConfigDB().npc.getInt("npc.Warrior.HP"));
this.setCustomName(new TextComponent("Herobrine Warrior"));
this.setCustomName(Component.literal("Herobrine Warrior"));
Zombie entityCast = (Zombie) this.getBukkitEntity();