-
on joining world it immediatly crashes
magic_man changed their profile photo
- get all online players
@Override public InteractionResult onItemUseFirst(ItemStack stack, UseOnContext context) { //get all online players //check if one of those players is in spectator mode and has a max health of 0 //set player gamemode to survival and set their max health to 6 stack.setCount(stack.getCount() - 1); return super.onItemUseFirst(stack, context); }- get all online players
MinecraftServer.getPlayerList()- get all online players
but like i said before, getPlayerList() isn't an option after MinecraftServer- get all online players
how do i get all online players in a server- how to make a player not able to move
an infinite loop is a loop that keeps looping until that condition is met, right?- how to make a player not able to move
i tried this: @SubscribeEvent public static void playerRespawn(PlayerRespawnEvent event) { Player player = event.getPlayer(); player.getAttribute(Attributes.MAX_HEALTH).setBaseValue(playerhealth - 2); if (playerhealth == 2) { ((ServerPlayer) player).setGameMode(GameType.SPECTATOR); Vec3 playerPos = player.position(); teleportPlayer (player, playerPos); } } static void teleportPlayer(Player player, Vec3 position) { while (playerhealth == 0) { player.setpos(position); } } but it just crashed me...without crashing me. basically nothing worked anymore from what i know, because i was stuck in spectator and commands didn't work anymore- how to make a player not able to move
how do i make a player not able to move, even in spectator?- questions about banning
spectator mode makes it so you can teleport to other players and see their location. you can also use it as a sort of xray i wasn't done with it but as a temporary solution i was trying to make a dead player get tped to 0 -100 0 and make them keep dying of the void until they get revived- questions about banning
in lifesteal, there is an item that when a player is banned, it can revive/unban that player and you get banned if you lose all your hearts if you don't trust me i can just send you all my code so it shows that i'm actually working on a lifesteal mod and not with some server wipe mod or something- questions about banning
still doesnt seem to exist- questions about banning
Server.getplayerlist() does not exist- questions about banning
someone asked me to make a lifesteal mod and i'm trying to make a way to revive someone after he gets banned. but i also dont know how to even ban someone sooo thats why i'm here- questions about banning
how to i detect who are banned, how to ban players, and how to unban them- spawn an entity in front of another entity
the way the entity is facing @Override public void performRangedAttack(LivingEntity p_33317_, float p_33318_) { if (this.distanceToSqr(p_33317_) >=10) { LightningBolt lightningbolt = new LightningBolt(EntityType.LIGHTNING_BOLT, this.level); //get the front of the entity //set the pos to (for example) 2 blocks in front of it this.level.addFreshEntity(lightningbolt); (the 'if distancetosqr' was an attempt to try alternate between attacks)
IPS spam blocked by CleanTalk.
Important Information
By using this site, you agree to our Terms of Use.