Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

magic_man

Members
  • Posts

    36
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

magic_man's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. @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); }
  2. MinecraftServer.getPlayerList()
  3. but like i said before, getPlayerList() isn't an option after MinecraftServer
  4. how do i get all online players in a server
  5. an infinite loop is a loop that keeps looping until that condition is met, right?
  6. 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
  7. how do i make a player not able to move, even in spectator?
  8. 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
  9. 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
  10. Server.getplayerlist() does not exist
  11. 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
  12. how to i detect who are banned, how to ban players, and how to unban them
  13. 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)
  14. i'm trying to make lightning spawn in front of my entity in a row as a sort of attack but don't know how to make it actually detect what the front is and how you move it from there. i also have a second question, i want my entity to have multiple attacks, but currently it only prioritizes one and never does the other one.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.