Generation

generate functionSat, 22 Jul 2023

Plugin for spigot 1.8.8, when a player joins the server, it is transformed into a random hostile mob, either a blaze, creeper, pigman, zombie, enderman, skeleton, zombie baby, spider, slime, witch, ghast, cave spider, silverfish, magma cube.

@EventHandler public void onJoin(PlayerJoinEvent e) { EntityType random = EntityType.values()[new Random().nextInt(EntityType.values().length)]; if(random.isAlive()) { Entity entity = e.getPlayer().getWorld().spawnEntity(e.getPlayer().getLocation(), random); e.getPlayer().teleport(entity.getLocation()); entity.remove(); } }

Questions about programming?Chat with your personal AI assistant