Yarnwrap helper functions. This module has a Java dependency of Yarnwrap.
Using pully
/pully install yarn
{
"dependencies": {
"yarn": "0.1.0"
}
}- Download yarn.
- Unzip file content to .minecraft/config/jscore/modules/yarn/
The folder should look like this
.minecraft/config/jscore/
└── modules/
└── yarn/
└── package.json
| Identifier | Type | Description |
|---|---|---|
| yarn.client() | MinecraftClient | Instance of MinecarftClient |
| yarn.clientPlayer() | ClientPlayerEntity | Current player |
| yarn.player() | PlayerEntity | Current player |
| yarn.playerLiving() | LivingEntity | Current player |
| yarn.playerEntity() | Entity | Current player |
"One day I'll figure out how to determine whether one Minecraft class inherits another."
A list of all Fabric API events imports can be found in events.js.
Check the events index page on the Fabric wiki for more info.
Attempt to cast input to the target (Java) class, would throw an error if failed.
where F: (input: JavaObject A) → JavaObjectB
Returns a function which casts input to the target (Java) class.
yarn.toPlayerEntity(input: JavaObject) → PlayerEntity
Attempts to convert to PlayerEntity.
yarn.toLivingEntity(input: JavaObject) → LivingEntity
Attempts to convert to LivingEntity.
yarn.toEntity(input: JavaObject) → Entity
Attempts to convert to Entity.