Interface AttachmentSyncPredicate

All Superinterfaces:
BiPredicate<AttachmentTarget,ServerPlayerEntity>
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@NonExtendable @FunctionalInterface public interface AttachmentSyncPredicate extends BiPredicate<AttachmentTarget,ServerPlayerEntity>
A predicate that determines, for a specific attachment type, whether the data should be synchronized with a player's client, given the player's ServerPlayerEntity and the AttachmentTarget the data is linked to.

The class extends BiPredicate to allow for custom predicates, outside the ones provided by methods.

  • Method Details

    • all

      Returns:
      a predicate that syncs an attachment with all clients
    • targetOnly

      static AttachmentSyncPredicate targetOnly()
      Returns:
      a predicate that syncs an attachment only with the target it is attached to, when that is a player. If the target isn't a player, the attachment will be synced with no clients.
    • allButTarget

      static AttachmentSyncPredicate allButTarget()
      Returns:
      a predicate that syncs an attachment with every client except the target it is attached to, when that is a player. When the target isn't a player, the attachment will be synced with all clients.