SalvageBuilder
A builder class used to use the CTUtils#setSalvage(ResourceLocation, Map<ResourceLocation, SalvageBuilder>) method.
Requires PMMO 0.5.4 or above!
Importing the class
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.
Static Methods
@return A new salvage builder
Returns: A new salvage builder
Return Type: SalvageBuilder
Methods
The default chance irregardless of skills that this salvage will be obtained. default = 0.0
Return Type: SalvageBuilder
Parameter | Type | Description |
---|---|---|
Parameter chance | Type double | Description chance before skill based chances are added |
A map of skill names and chances. Salvage logic will take the chance value and multiply it by the player’s level in the skill used in the key to increase the player’s odds. This is done for all pairs in the map. default = no extra chance
Return Type: SalvageBuilder
Parameter | Type | Description |
---|---|---|
Parameter chancePerLevel | Type double?[string] | Description the increase in chance per level in skill |
The required levels to have this specific salvage item checked against the chance attributes. default = no requirements
Return Type: SalvageBuilder
Parameter | Type | Description |
---|---|---|
Parameter levelReq | Type int?[string] | Description the requirements to attempt this result |
The maximum chance to obtain this item. This acts as a ceiling for obtaining items where skills levels may create a 100% chance case that is not desired default = 1.0
Return Type: SalvageBuilder
Parameter | Type | Description |
---|---|---|
Parameter chance | Type double | Description chance ceiling for this item |
The most of this item that can be obtained from salvage default = 1
Return Type: SalvageBuilder
Parameter | Type | Description |
---|---|---|
Parameter max | Type int | Description the maximum output of this item |
The xp that should be awarded when this item is successfully obtained from salvage default = no xp awarded
Return Type: SalvageBuilder
Parameter | Type | Description |
---|---|---|
Parameter xpAward | Type long?[string] | Description a map of skills and their associated xp awards |