-
-
Notifications
You must be signed in to change notification settings - Fork 6
Pre 1.4
An SpoilData Object consists of the spoiling data.
To properly use the Object you should import the package using the following import:
import mods.spoiled.SpoilData;
To construct an SpoilData Object you need to insert the following parameters (spoilTime is in seconds)
String uniqueID, IItemStack foodStack, IItemStack spoilStack, int spoilTime
An example would be the following:
var BeefToRotten = new SpoilData("BeefToRotten", <item:minecraft:beef>, <item:minecraft:rotten_flesh>, 1200);
Which would cause Beef to turn into Rotten Flesh after 1 minecraft day. (1200 seconds / 60 = 20 minutes)
To register the SpoilData object you can should import the ChangeSpoiling package using:
import mods.spoiled.ChangeSpoiling;
An example would be:
ChangeSpoiling.addSpoiling(BeefToRotten); (Which would register the example variable above)
ChangeSpoiling.addModSpoiling(String modID, IItemStack spoilStack, int spoilTime); (Syntax)
ChangeSpoiling.addModSpoiling("simplefarming", <item:minecraft:rotten_flesh>, 1200); (An example that will add spoiling to all food items from simplefarming) (turning them into rotten flesh when spoiled)
ChangeSpoiling.replaceSpoiling(BeefToRotten); (Which would replace the known SpoilData Object with the same UniqueID with the constructed one in the example above)
ChangeSpoiling.removeSpoiling("BeefToRotten"); (Which would remove the SpoilData known by the ID BeefToRotten from the example above)
If you want the item to disappear after spoiling you need to set the result stack to <item:minecraft:air>
An example script that makes dirt spoil into diamond blocks after 12 tries can be found Here
For questions feel free to join our Discord