Updated setting of custom names on custom entities for Spigot 1.19.
This commit is contained in:
parent
36ed006f89
commit
59e815e5ba
@ -9,7 +9,7 @@ import java.util.Random;
|
|||||||
|
|
||||||
import org.bukkit.Color;
|
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.Entity;
|
||||||
import net.minecraft.world.entity.EntityType;
|
import net.minecraft.world.entity.EntityType;
|
||||||
import net.minecraft.world.entity.ai.attributes.Attributes;
|
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.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.getAttribute(Attributes.MAX_HEALTH).setBaseValue(Herobrine.getPluginCore().getConfigDB().npc.getInt("npc.Demon.HP"));
|
||||||
this.setHealth(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();
|
Skeleton entityCast = (Skeleton) this.getBukkitEntity();
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ import org.bukkit.Material;
|
|||||||
import org.bukkit.entity.Zombie;
|
import org.bukkit.entity.Zombie;
|
||||||
import org.bukkit.inventory.ItemStack;
|
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.Entity;
|
||||||
import net.minecraft.world.entity.EntityType;
|
import net.minecraft.world.entity.EntityType;
|
||||||
import net.minecraft.world.entity.ai.attributes.Attributes;
|
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.getAttribute(Attributes.MAX_HEALTH).setBaseValue(Herobrine.getPluginCore().getConfigDB().npc.getInt("npc.Guardian.HP"));
|
||||||
this.setHealth(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();
|
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.getAttribute(Attributes.MAX_HEALTH).setBaseValue(Herobrine.getPluginCore().getConfigDB().npc.getInt("npc.Warrior.HP"));
|
||||||
this.setHealth(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();
|
Zombie entityCast = (Zombie) this.getBukkitEntity();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user