Class ExpandLevelAccessor
java.lang.Object
com.blamejared.crafttweaker.natives.world.ExpandLevelAccessor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.world.DifficultyInstancegetCurrentDifficultyAt(net.minecraft.world.level.LevelAccessor internal, net.minecraft.core.BlockPos position) static net.minecraft.world.DifficultygetDifficulty(net.minecraft.world.level.LevelAccessor internal) Gets the difficulty setting for the world.static net.minecraft.world.level.storage.LevelDatagetLevelData(net.minecraft.world.level.LevelAccessor internal) Gets the data for this level, holds information such as if it is raining, thundering, difficulty, etcstatic net.minecraft.util.RandomSourcegetRandom(net.minecraft.world.level.LevelAccessor internal) static voidlevelEvent(net.minecraft.world.level.LevelAccessor internal, int event, net.minecraft.core.BlockPos position, int extra) Triggers a predetermined event on the client.static voidlevelEvent(net.minecraft.world.level.LevelAccessor internal, net.minecraft.world.entity.player.Player excluded, int event, net.minecraft.core.BlockPos position, int extra) Triggers a predetermined event on the client.static voidplaySound(net.minecraft.world.level.LevelAccessor internal, net.minecraft.world.entity.player.Player player, net.minecraft.core.BlockPos position, net.minecraft.sounds.SoundEvent event, net.minecraft.sounds.SoundSource source) static voidplaySound(net.minecraft.world.level.LevelAccessor internal, net.minecraft.world.entity.player.Player player, net.minecraft.core.BlockPos position, net.minecraft.sounds.SoundEvent event, net.minecraft.sounds.SoundSource source, float volume, float pitch)
-
Constructor Details
-
ExpandLevelAccessor
public ExpandLevelAccessor()
-
-
Method Details
-
getLevelData
public static net.minecraft.world.level.storage.LevelData getLevelData(net.minecraft.world.level.LevelAccessor internal) Gets the data for this level, holds information such as if it is raining, thundering, difficulty, etc- Returns:
- The data for this level
-
getCurrentDifficultyAt
public static net.minecraft.world.DifficultyInstance getCurrentDifficultyAt(net.minecraft.world.level.LevelAccessor internal, net.minecraft.core.BlockPos position) -
getDifficulty
public static net.minecraft.world.Difficulty getDifficulty(net.minecraft.world.level.LevelAccessor internal) Gets the difficulty setting for the world.- Returns:
- The difficulty setting for the world.
-
getRandom
public static net.minecraft.util.RandomSource getRandom(net.minecraft.world.level.LevelAccessor internal) -
playSound
public static void playSound(net.minecraft.world.level.LevelAccessor internal, net.minecraft.world.entity.player.Player player, net.minecraft.core.BlockPos position, net.minecraft.sounds.SoundEvent event, net.minecraft.sounds.SoundSource source) -
playSound
public static void playSound(net.minecraft.world.level.LevelAccessor internal, net.minecraft.world.entity.player.Player player, net.minecraft.core.BlockPos position, net.minecraft.sounds.SoundEvent event, net.minecraft.sounds.SoundSource source, float volume, float pitch) -
levelEvent
public static void levelEvent(net.minecraft.world.level.LevelAccessor internal, net.minecraft.world.entity.player.Player excluded, int event, net.minecraft.core.BlockPos position, int extra) Triggers a predetermined event on the client. Using this on a server or integrated server will send the event to all nearby players.- Parameters:
excluded- An excluded player who will not receive the event.event- The ID of the event to play.position- The position of the event.extra- Four bytes of additional data encoded as an integer. This is generally unused.- DocParam:
- excluded player, eventId 2005, pos new BlockPos(0, 1, 2), data 0
-
levelEvent
public static void levelEvent(net.minecraft.world.level.LevelAccessor internal, int event, net.minecraft.core.BlockPos position, int extra) Triggers a predetermined event on the client. Using this on a server or integrated server will send the event to all nearby players.- Parameters:
event- The ID of the event to play.position- The position of the event.extra- Four bytes of additional data encoded as an integer. This is generally unused.- DocParam:
- excluded player, eventId 2005, pos new BlockPos(0, 1, 2), data 0
-