LootContextParams
Link to lootcontextparams
These are pre-registered params that are used by vanilla.
You can also create your own using getOrCreate
导入类
Link to 导入类
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
ZenScript Copyimport crafttweaker.api.loot.param.LootContextParams;
Static Methods
Link to static-methods
Name: blockEntity
Gets the 'block_entity' param.
Returns: The 'block_entity' param.
Return Type: LootContextParam<BlockEntity>
ZenScript Copy// LootContextParams.blockEntity() as LootContextParam<BlockEntity>
LootContextParams.blockEntity();
Name: blockState
Gets the 'block_state' param.
Returns: The 'block_state' param.
Return Type: LootContextParam<BlockState>
ZenScript Copy// LootContextParams.blockState() as LootContextParam<BlockState>
LootContextParams.blockState();
Name: damageSource
Gets the 'damage_source' param.
Returns: The 'damage_source' param.
Return Type: LootContextParam<DamageSource>
ZenScript Copy// LootContextParams.damageSource() as LootContextParam<DamageSource>
LootContextParams.damageSource();
Name: directKillerEntity
Gets the 'direct_killer_entity' param.
Returns: The 'direct_killer_entity' param.
Return Type: LootContextParam<Entity>
ZenScript Copy// LootContextParams.directKillerEntity() as LootContextParam<Entity>
LootContextParams.directKillerEntity();
Name: explosionRadius
Gets the 'explosion_radius' param.
Returns: The 'explosion_radius' param.
Return Type: LootContextParam<float?>
ZenScript Copy// LootContextParams.explosionRadius() as LootContextParam<float?>
LootContextParams.explosionRadius();
Name: getOrCreate
Gets or creates a new parameter with the given name, using the given type.
Returns: The parameter with the given name or a new parameter if there are no registered parameters with the name.
Return Type: LootContextParam<T>
ZenScript CopyLootContextParams.getOrCreate<T : Object>(name as ResourceLocation, tClass as Class<T>) as LootContextParam<T>
参数 | 类型 | 描述 |
---|---|---|
参数 name(名称) | 类型 资源位置 | 描述 The name of the parameter. |
参数 tClass | 类型 Class<T> | 描述 |
参数 T | 类型 Object | 描述 The type that the parameter acts on. |
Name: killerEntity
Gets the 'killer_entity' param.
Returns: The 'killer_entity' param.
Return Type: LootContextParam<Entity>
ZenScript Copy// LootContextParams.killerEntity() as LootContextParam<Entity>
LootContextParams.killerEntity();
Name: lastDamagePlayer
Gets the 'last_damage_player' parameter.
Returns: The 'last_damage_player' parameter.
Return Type: LootContextParam<Player>
ZenScript Copy// LootContextParams.lastDamagePlayer() as LootContextParam<Player>
LootContextParams.lastDamagePlayer();
Name: origin
Gets the 'origin' param.
Returns: The 'origin' param.
Return Type: LootContextParam<Vec3>
ZenScript Copy// LootContextParams.origin() as LootContextParam<Vec3>
LootContextParams.origin();
Name: thisEntity
Gets the 'this_entity' parameter.
Returns: The 'this_entity' parameter.
Return Type: LootContextParam<Entity>
ZenScript Copy// LootContextParams.thisEntity() as LootContextParam<Entity>
LootContextParams.thisEntity();
Name: tool
Gets the 'tool' param.
Returns: The 'tool' param.
Return Type: LootContextParam<ItemStack>
ZenScript Copy// LootContextParams.tool() as LootContextParam<ItemStack>
LootContextParams.tool();