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.

Leaderboard

Popular Content

Showing content with the highest reputation on 09/12/22 in all areas

  1. As usual with this stuff, what you need to do depends upon the use case. People get very confused about this mainly because they don't fully understand what they need to do. That people try to blindly copy tutorials for this doesn't help them. If this really is your own entity then a "simple" way is to use an EntityDataAccessor with EntityDataSerializers.COMPOUND_TAG (the CompoundTag will be used to store the serialized form of your inventory over the network). See: https://forge.gemwire.uk/wiki/Networking_with_Entities An example of the pattern is how ItemEntity handles its ItemStack: ItemEntity.DATA_ITEM On the client you override onSynchedDataUpdated() to process the data. But the important part is the call to getEntityData().set() which needs to be called when your entity is created or reloaded from disk and when the data changes. Since you are probably using an ItemStackHandler you can make your own custom subclass to override load() and onContentsChanged() to forward these events to that set(). However, if this is a capability you are adding to other people's entities then you do need to do your own network handling and you need to be somewhat careful about who you send the packets to. https://forge.gemwire.uk/wiki/SimpleChannel Your network packet will need to contain the inventory and the entityId so you can find the entity and update the capability when it gets to the client. You need to trap the change of the inventory as before and broadcasting to all players that are tracking the entity using PacketDistributor.TRACKING_ENTITY. But for the create/load of entities you will instead need to subscribe to PlayerEvent.StartTracking and just send the packet to that player. The StartTracking event tells you when an entity comes into range of player and the PacketDistributor.TRACKING_ENTITY knows which players are still in range of the entity. NOTE: For your own entity it is still an option to do custom network handling instead of the EntityDataAccessor. This would be case for example if you have a large inventory and only want to send changed items instead of the whole inventory every time.
  2. [Info: 2022-09-12 19:37:52.7561548: GameCallbacks.cpp(177)] Game/game () Info Caused by: java.lang.NoSuchFieldError: COMPOUND_TAG [Info: 2022-09-12 19:37:52.7561699: GameCallbacks.cpp(177)] Game/game () Info at TRANSFORMER/[email protected]/net.minecraft.world.entity.LivingEntity.<clinit>(LivingEntity.java:155) [Info: 2022-09-12 19:37:52.7561874: GameCallbacks.cpp(177)] Game/game () Info at TRANSFORMER/[email protected]/net.minecraft.world.entity.EntityType.<clinit>(EntityType.java:252) Issue with citadel: https://github.com/AlexModGuy/Citadel/issues/81

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.