LevelAccessor
Link to levelaccessor
Importing the class
Link to 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.
ZenScript Copyimport crafttweaker.api.world.LevelAccessor;
Methods
Link to methods
Name: getCurrentDifficultyAt
Return Type: DifficultyInstance
ZenScript CopyLevelAccessor.getCurrentDifficultyAt(position as BlockPos) as DifficultyInstance
Parameter | Type |
---|---|
Parameter position | Type BlockPos |
Name: hasChunk
Return Type: boolean
ZenScript CopyLevelAccessor.hasChunk(x as int, y as int) as boolean
Parameter | Type |
---|---|
Parameter x | Type int |
Parameter y | Type int |
Name: levelEvent
Triggers a predetermined event on the client. Using this on a server or integrated server will send the event to all nearby players.
ZenScript CopyLevelAccessor.levelEvent(event as int, position as BlockPos, extra as int)
Parameter | Type | Description |
---|---|---|
Parameter event | Type int | Description The ID of the event to play. |
Parameter position | Type BlockPos | Description The position of the event. |
Parameter extra | Type int | Description Four bytes of additional data encoded as an integer. This is generally unused. |
Name: levelEvent
Triggers a predetermined event on the client. Using this on a server or integrated server will send the event to all nearby players.
ZenScript CopyLevelAccessor.levelEvent(excluded as Player?, event as int, position as BlockPos, extra as int)
Parameter | Type | Description |
---|---|---|
Parameter excluded | Type Player? | Description An excluded player who will not receive the event. |
Parameter event | Type int | Description The ID of the event to play. |
Parameter position | Type BlockPos | Description The position of the event. |
Parameter extra | Type int | Description Four bytes of additional data encoded as an integer. This is generally unused. |
Name: playSound
ZenScript CopyLevelAccessor.playSound(player as Player?, position as BlockPos, event as SoundEvent, source as SoundSource)
Parameter | Type |
---|---|
Parameter player | Type Player? |
Parameter position | Type BlockPos |
Parameter event | Type SoundEvent |
Parameter source | Type SoundSource |
Name: playSound
ZenScript CopyLevelAccessor.playSound(player as Player?, position as BlockPos, event as SoundEvent, source as SoundSource, volume as float, pitch as float)
Parameter | Type |
---|---|
Parameter player | Type Player? |
Parameter position | Type BlockPos |
Parameter event | Type SoundEvent |
Parameter source | Type SoundSource |
Parameter volume | Type float |
Parameter pitch | Type float |
Properties
Link to properties
Name | Type | Has Getter | Has Setter | Description |
---|---|---|---|---|
Name difficulty | Type Difficulty | Has Getter true | Has Setter false | Description Gets the difficulty setting for the world. |
Name levelData | Type LevelData | Has Getter true | Has Setter false | Description Gets the data for this level, holds information such as if it is raining, thundering, difficulty, etc |
Name random | Type RandomSource | Has Getter true | Has Setter false | Description |