-
Notifications
You must be signed in to change notification settings - Fork 11
PlayerStat
youyihj edited this page Nov 22, 2022
·
2 revisions
A PlayerStat represents a statistic field of players. See ZenUtilsPlayer for how to get or set value of a player's statistic value.
You'd better import the package to avoid errors and write script easier.
Class Name: mods.zenutils.PlayerStat
These static methods are available for getting a PlayerStat.
Gets a basic stat (i.e. in general column). Call /ct stats command to get a list of all basic stats.
PlayerStat.getBasicStat(String id)
The following methods are for items, blocks and entities.
PlayerStat.getBlockStats(IBlockDefinition block)PlayerStat.getCraftStats(IItemDefinition item)PlayerStat.getObjectUseStats(IItemDefinition item)PlayerStat.getObjectBreakStats(IItemDefinition item)PlayerStat.getObjectsPickedUpStats(IItemDefinition item)PlayerStat.getDroppedObjectStats(IItemDefinition item)PlayerStat.getKillEntityStats(IEntityDefinition entity)PlayerStat.getKilledByEntityStats(IEntityDefinition entity)
PlayerStat.create(String id, ITextComponent name, @Optional IStatFormatter formatter)
It is required to create a PlayerStat in game initialization. Creating a stat and putting it into a static variable is needed.
Parameters:
- String id: The id of the PlayerStat
- ITextComponent name: The name of the PlayerStat, shown in the Statistics menu
- IStatFormatter formatter: How to display the stat amount, such as adding separator or converting to time format
| Name | Type |
|---|---|
| name | ITextComponent |
- GlobalFunctions
- ScriptReloading
- SuppressErrorPreprocessor
- HardFailPreprocessor
- OrderlyMap
- IData Deep Update
- Template String
- Nullish Operators
- Array and List Operations
- Native Method Access
- Mixin
- CrTI18n
- CrTUUID
- CrTItemHandler
- CrTLiquidHandler
- ILiquidTankProperties
- StringList
- HexHelper
- StaticString
- Catenation
- PersistedCatenation
- PlayerStat
- IStatFormatter
- GameRuleHelper
- ZenCommand
- ZenCommandTree
- ZenUtilsCommandSender
- IGetCommandUsage
- ICommandExecute
- IGetTabCompletion
- CommandUtils