Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

magic_man

Members
  • Joined

  • Last visited

  1. magic_man changed their profile photo
  2. @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); }
  3. MinecraftServer.getPlayerList()
  4. but like i said before, getPlayerList() isn't an option after MinecraftServer
  5. how do i get all online players in a server
  6. an infinite loop is a loop that keeps looping until that condition is met, right?
  7. 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
  8. how do i make a player not able to move, even in spectator?
  9. 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
  10. 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
  11. still doesnt seem to exist
  12. Server.getplayerlist() does not exist
  13. 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
  14. how to i detect who are banned, how to ban players, and how to unban them
  15. 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)

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.