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.

vova7865

Members
  • Joined

  • Last visited

  1. What do you have in projectDir/build/tmp/recompileMc ?
  2. Try gradlew setupDecompWorkspace --stacktrace , then post the log
  3. Thanks! Another question: do ElderGuardians fire this event when they spawn in the monuments?
  4. So how can I subscribe to them?
  5. Write the list of your mods, some of them may not be compatible.
  6. I have this code: package com.vova7865.essencecraft; import java.util.UUID; import com.mojang.authlib.GameProfile; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.server.MinecraftServer; import net.minecraft.world.World; import net.minecraft.world.WorldServer; import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.util.FakePlayer; import net.minecraftforge.event.entity.living.LivingSpawnEvent; import net.minecraftforge.fml.common.Mod.EventBusSubscriber; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @EventBusSubscriber public class EventHandler { @SubscribeEvent public void livingSpawn(LivingSpawnEvent event) { if(event.getEntityLiving().toString().contains("Guardian")) { EntityLiving living = (EntityLiving) event.getEntityLiving(); World world = event.getWorld(); WorldServer serverWorld = DimensionManager.getWorld(0); GameProfile gameProfile = new GameProfile(UUID.randomUUID(), "FakePlayer"); FakePlayer fakePlayer = new FakePlayer(serverWorld, gameProfile); MinecraftServer minecraftServer = fakePlayer.mcServer; String playerNames[] = minecraftServer.getOnlinePlayerNames(); String firstPlayerName = playerNames[0]; EntityPlayer player = world.getPlayerEntityByName(firstPlayerName); double x = player.posX; double y = player.posY; double z = player.posZ; living.attemptTeleport(x, y, z) } } } So when the guardians spawn, they teleport to me. They do, but the same guardians are teleported to me multiple times, so I think that LivingSpawnEvent is fired not only when they spawn. Anyone knows how can I do some code only when the mob spawns?

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.