promotional bannermobile promotional banner
header
logo

PowerfulJS

Install

Adds Forge's Capability system integration for KubeJS. With PowerfulJS, you can retrieve, attach capabilities supported for ItemStacks, Block Entities and so on!

 

What's the Capability? For details, you can check out here, the official document of Capability system from forge.

 

In brief, Capability attached to something makes the thing support to do something: A TE Energy Cell has the Capability for Forge Energy, so it can receive or extract Forge Energy directly. Any furnace in Minecraft has the Capability for Item Handling (attached through Forge's modifications), so item pipes or conveyor belts can insert of extract items directly from it.

 

Via PowerfulJS, you can now attach capabilities supported to ItemStacks, Block Entities and possibly more, and also customize the behavior of the capability. Like to make a furnace to output energy while working, or to make an item chargeable by Forge Energy, and so on.

 

Documents are still on the way, but you can check out ProbeJS for auto-completions and type-hinting.

 

To access a capability of something (e.g. an ItemStack or a BlockEntity), use the following supported capability tokens provided with `.getCapability`:

  • ForgeCapabilities
  • BotaniaCapabilities (Requires Botania)
  • PNCCapabilities (Requires PNC: Repressurized)
  • MekanismCapabilities (Requires Mekanism)
  • CuriosCapabilities (Requires Curios)
  • IECapabilities (Requires Immersive Engineering)

To build your own capabilities, use the following supported capability builders as in Example 2 or 3:

  • CapabilityBuilder
  • BotaniaCapabilityBuilder (Requires Botania)
  • PNCCapabilityBuilder (Requires PNC: Repressurized)
  • MekanismCapabilityBuilder (Requires Mekanism)
  • CuriosCapabilities (Requires Curios)
  • IECapabilityBuilder (Requires Immersive Engineering)

Auto-completions are provided with ProbeJS.

 

Examples:

 

Makes TE Energy Cell able to receive Botania Mana and convert it to FE 1:1: script (startup_scripts) 

 

Creates an item that produces infinite energy and can charge any TE machine: script (startup_scripts)

 

Creates a block that can store FE, like an Energy Cell (but passive since it contains no logic itself, meaning that it won't actively pull or send energy to other blocks): script (startup_scripts)