Posted March 4, 20196 yr I didn't really understand the Forge Capabilities docs and I was asking if someone could help me digest the information. Things I understand: Capabilities provide a way to save data, like energy or inventories. How am I supposed to change data about a tile entity using capabilities? I understand how to create a custom capability, but after that I was lost.
March 5, 20196 yr Author 5 hours ago, diesieben07 said: What kind of data do you want to change? It would help if you could explain what you are actually trying to achieve. I’m not trying to achieve anything atm. I just want to know what I can do with it and how. I just want someone to break down some of the information provided in the documents because I don’t really understand it. But, because it will be a complete waste of time rewording everything, lets just say I want to make power levels for an item. This item carrys only a single integer that cannot be higher than 20. How would I implement the capability system to do such thing? Edited March 5, 20196 yr by FrostBytes very vague comment
March 5, 20196 yr Capabilities are a better way of achieving the same thing as Interfaces. Interface way: if (tileEntity instanceof IThing) Capability way if (tileEntity.hasCapability(ThingCapability)) Interface way: ((IThing)tileEntity).doThing(); Capability way tileEntity.getCapability(ThingCapability).doThing(); Interfaces make your tile be something while Capabilities let your tile provide something. Capabilities follow the OOP concept of "Composition over Inheritance". About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)
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.