Skip to content
Anthony Jones edited this page Aug 31, 2023 · 13 revisions

Welcome to the CapabilitySyncer wiki!

Structuring your Capability:

You can find Examples here

Registering your Capability

public ExampleMod(){
  ExampleHolderAttacher.register();
}

Registering your Sync Packet

Register the Packer by calling

SimpleEntityCapabilityStatusPacket.register(channel,id)

(call this wherever you register your packets)

SimpleEntityCapabilityStatusPacket.registerRetriever(ExampleHolderAttacher.RESOURCE_LOCATION, ExampleHolderAttacher::getHolderUnwrap);

Using your Capability

ExampleHolderAttacher.getHolder(example_object).ifPresent(
  holder -> {
    holder.getValue();
    holder.setValue(value);
  }
);