Posted October 25, 20213 yr Whenever i logout and back-in in the game, the data resets to its define state (how can i save the entity data to be persistent) the code words, data is used flawlessly, but just doesn't save through game exit public class TyBoss extends Monster{ public static final EntityDataAccessor<Boolean> STILL_HOSTILE = SynchedEntityData.defineId(TyBoss.class, EntityDataSerializers.BOOLEAN); private static final EntityDataAccessor<Byte> SCOUNT_TAG = SynchedEntityData.defineId(TyBoss.class, EntityDataSerializers.BYTE); (...) protected void defineSynchedData() { super.defineSynchedData(); this.entityData.define(SCOUNT_TAG, (byte) 0); this.entityData.define(STILL_HOSTILE, true); } (...) public void startSeenByPlayer(ServerPlayer p_01_) { super.startSeenByPlayer(p_01_); if (this.entityData.get(STILL_HOSTILE)) { this.bossEvent.addPlayer(p_01_);} } public void stopSeenByPlayer(ServerPlayer p_01_) { super.stopSeenByPlayer(p_01_); this.bossEvent.removePlayer(p_01_); } (...) } Edited October 25, 20213 yr by spiritfilled
October 26, 20213 yr Author found it! thanks a bunch... (btw, how come ur always the one answering my questions?) do u work at minecraft?
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.