Posted July 5, 20241 yr In the 1.21 the SynchedEntityData object is final and it's unable to add new Player attributes using traditional EntityConstructing. I make sense to fire the event a little earlier and pass SynchedEntityData.Builder object in it. See example below. public Entity(EntityType<?> p_19870_, Level p_19871_) { ... synchedentitydata$builder.define(DATA_TICKS_FROZEN, 0); this.defineSynchedData(synchedentitydata$builder); // suggested injection net.minecraftforge.event.ForgeEventFactory.onEntityConstructing(this, synchedentitydata$builder); this.entityData = synchedentitydata$builder.build(); this.setPos(0.0, 0.0, 0.0); this.eyeHeight = this.dimensions.eyeHeight(); // current injection net.minecraftforge.event.ForgeEventFactory.onEntityConstructing(this); this.gatherCapabilities(); }
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.