Remove entity from world on delete

This commit is contained in:
Teriuihi 2021-12-23 22:51:12 +01:00
parent f0c9edfdac
commit b52aaee628

View File

@ -4,6 +4,7 @@ import com.alttd.commands.SubCommand;
import com.alttd.config.Config;
import com.alttd.config.VillagerConfig;
import com.alttd.objects.LoadedVillagers;
import net.kyori.adventure.text.minimessage.Template;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
@ -30,6 +31,8 @@ public class CommandRemoveVillager extends SubCommand {
continue;
LoadedVillagers.removeLoadedVillager(uuid);
VillagerConfig.removeVillager(uuid);
entity.remove();
player.sendMessage(getMiniMessage().parse(Config.REMOVED_VILLAGER, Template.of("uuid", uuid.toString())));
}
return true;
}