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.

genandnic

Members
  • Joined

  • Last visited

  1. Thank you, this works perfectly!
  2. Hostile mobs usually despawn once the player moves away from them, typically once they're 128 blocks away. But passive mobs won't despawn, not by default anyway. I want to spawn a cow that will dissapear once unloaded. I thought I could do this by spawning a mob with "PersistenceRequired" set to false, but this doesn't seem to work: List<ResourceLocation> entities = new ArrayList<ResourceLocation>(EntityList.ENTITY_EGGS.keySet()); ResourceLocation randomResource = entities.get(rand.nextInt(entities.size())); Entity randomEntity = EntityList.createEntityByIDFromName(randomResource, entity.world); if (!randomEntity.isNonBoss()) return; NBTTagCompound nbt = new NBTTagCompound(); nbt.setBoolean("PersistenceRequired", false); ((EntityLiving) randomEntity).readEntityFromNBT(nbt); randomEntity.setPositionAndRotation(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch); entity.world.spawnEntity(randomEntity); entity.setDead();

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.