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.

Ph1l

Members
  • Joined

  • Last visited

  1. Thank you so much! Works perfectly now, using the Consumer.
  2. Forge Version: 1.19.3 - 44.0.37 Hey, I've made a small mod with a nexus(just a blockentity) that spawns (monster)entitys. They should walk towards the nexus in order to destroy it. Because there could be multiple nexuses, every spawned monster would need to know which nexus it was spawned by. In order to do that I thought I could just give every monster the nexus's BlockPos in nbt data. The way I'm trying to do this is: ModEntityTypes.NEXUS_ZOMBIE.get().spawn(level, (CompoundTag) new CompoundTag().put("NexusPos", NbtUtils.writeBlockPos(getBlockPos())), (Consumer<T>)null, spawnPosition, MobSpawnType.EVENT, false, false); And then I get the nbt data of the spawned entity by using the command /data get entity [ e.g. fef9ec95-4e46-4063-9221-6ff624c9e603] ingame. But the tag NexusPos is not present there: I've dug a little into the spawn method which just forwards to EntityType.create. The create method only uses the compound tag to call Mob.finalizeSpawn, which does not use the compound tag. I have a couple Questions Is using nbt data for what I am trying to accomplish the right tool? Is the compound tag argument ment to give the spawned entity it's nbt data? If not, how would I set the nbt data after or while spawning? Is the way I am reading nbt via the command the correct way? Do I have to manually sync changes to the nbt between the client and server? If any more code is required to answer the question, just tell me :) Thanks!

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.