Class ExpandPlayer
java.lang.Object
com.blamejared.crafttweaker.natives.entity.type.player.ExpandPlayer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanaddItem(net.minecraft.world.entity.player.Player internal, net.minecraft.world.item.ItemStack stack) Adds an item to the player's inventory.static voidattack(net.minecraft.world.entity.player.Player internal, net.minecraft.world.entity.Entity entity) Attacks an entity.static voidawardStat(net.minecraft.world.entity.player.Player internal, net.minecraft.resources.ResourceLocation stat) Awards a stat to the player.static voidawardStat(net.minecraft.world.entity.player.Player internal, net.minecraft.resources.ResourceLocation stat, int amount) Awards a stat to the player.static booleancanEat(net.minecraft.world.entity.player.Player internal, boolean ignoreHunger) Checks if the player can eat.static booleancanHarmPlayer(net.minecraft.world.entity.player.Player internal, net.minecraft.world.entity.player.Player player) Checks if the player can harm another player.static booleancanUseGameMasterBlocks(net.minecraft.world.entity.player.Player internal) Checks if the player can use game master blocks such as command blocks.static voidcauseFoodExhaustion(net.minecraft.world.entity.player.Player internal, float exhaustion) Adds food exhaustion to the player.static voidcrit(net.minecraft.world.entity.player.Player internal, net.minecraft.world.entity.Entity entity) Spawns critical hit particle at the hit entity.static voiddisableShield(net.minecraft.world.entity.player.Player internal) Disables the shield of the player.static voiddisplayClientMessage(net.minecraft.world.entity.player.Player internal, net.minecraft.network.chat.Component component, boolean actionBar) Displays a message to the client.static net.minecraft.world.entity.item.ItemEntitydrop(net.minecraft.world.entity.player.Player internal, net.minecraft.world.item.ItemStack stack, boolean traceItem) Drops an item in the world as if the player dropped it.static net.minecraft.world.entity.player.AbilitiesgetAbilities(net.minecraft.world.entity.player.Player internal) Gets the abilities of the player.static net.minecraft.world.item.ItemCooldownsgetCooldowns(net.minecraft.world.entity.player.Player internal) Gets the cooldowns of the player.static floatgetCurrentItemAttackStrengthDelay(net.minecraft.world.entity.player.Player internal) Gets the current item attack strength delay of the player.static floatgetDestroySpeed(net.minecraft.world.entity.player.Player internal, net.minecraft.world.level.block.state.BlockState state) Gets the destroy speed of the player for a givenBlockState.static intgetEnchantmentSeed(net.minecraft.world.entity.player.Player internal) Gets the enchantment seed of the player.static intgetExperienceLevel(net.minecraft.world.entity.player.Player internal) Gets the experience level of the player.static net.minecraft.world.food.FoodDatagetFoodData(net.minecraft.world.entity.player.Player internal) Gets the food data of the player.static net.minecraft.world.entity.player.InventorygetInventory(net.minecraft.world.entity.player.Player internal) Gets the inventory of the player.static floatgetLuck(net.minecraft.world.entity.player.Player internal) Gets the luck of the player.static net.minecraft.world.entity.HumanoidArmgetMainArm(net.minecraft.world.entity.player.Player internal) Gets the main arm of the player.static intgetScore(net.minecraft.world.entity.player.Player internal) Gets the score of the player.static MapDatagetShoulderEntityLeft(net.minecraft.world.entity.player.Player internal) Gets the entity on the player's left shoulder.static MapDatagetShoulderEntityRight(net.minecraft.world.entity.player.Player internal) Gets the entity on the player's right shoulder.static intgetSleepTimer(net.minecraft.world.entity.player.Player internal) Gets the sleep timer of the player.static intgetXpNeededForNextLevel(net.minecraft.world.entity.player.Player internal) Gets the amount of experience needed to reach the next level.static voidgive(net.minecraft.world.entity.player.Player internal, IItemStack stack, int slot) Gives the player an item.static voidgiveExperienceLevels(net.minecraft.world.entity.player.Player internal, int levels) Gives the player experience levels.static voidgiveExperiencePoints(net.minecraft.world.entity.player.Player internal, int amount) Gives the player experience points.static booleanhasCorrectToolForDrops(net.minecraft.world.entity.player.Player internal, net.minecraft.world.level.block.state.BlockState state) Checks if the player has the correct tool for the givenBlockState.static voidincreaseScore(net.minecraft.world.entity.player.Player internal, int score) Increases the score of the player.static booleanisCreative(net.minecraft.world.entity.player.Player internal) Checks if the player is creative.static booleanisFakePlayer(net.minecraft.world.entity.player.Player internal) Checks if this player is a fake player, mainly used for machines.static booleanisHurt(net.minecraft.world.entity.player.Player internal) Checks if the player is hurt.static booleanisLocalPlayer(net.minecraft.world.entity.player.Player internal) Checks if the player is the local player.static booleanisReducedDebugInfo(net.minecraft.world.entity.player.Player internal) Checks if the player has reduced debug info.static booleanisScoping(net.minecraft.world.entity.player.Player internal) Checks if the player is scoping like when using a SpyGlass.static booleanisSecondaryUseActive(net.minecraft.world.entity.player.Player internal) Checks if the secondary use is active, this usually means that the player is sneaking.static booleanisSleepingLongEnough(net.minecraft.world.entity.player.Player internal) Checks if the player has been in bed long enough to trigger sleeping.static voidjumpFromGround(net.minecraft.world.entity.player.Player internal) Makes the player jump from the ground.static voidmagicCrit(net.minecraft.world.entity.player.Player internal, net.minecraft.world.entity.Entity entity) Spawns magic critical hit particle at the hit entity.static booleanmayBuild(net.minecraft.world.entity.player.Player internal) Checks if the player may build.static voidplayNotifySound(net.minecraft.world.entity.player.Player internal, net.minecraft.sounds.SoundEvent event, net.minecraft.sounds.SoundSource source, float volume, float pitch) Plays a sound for the player.static voidrespawn(net.minecraft.world.entity.player.Player internal) Respawns the player.static voidsendMessage(net.minecraft.world.entity.player.Player internal, net.minecraft.network.chat.Component text) Sends a message to the player.static booleansetEntityOnShoulder(net.minecraft.world.entity.player.Player internal, MapData entityData) Sets an entity on the player's shoulder.static voidsetExperienceLevel(net.minecraft.world.entity.player.Player internal, int level) Sets the experience level of the player.static voidsetMainArm(net.minecraft.world.entity.player.Player internal, net.minecraft.world.entity.HumanoidArm arm) Sets the main arm of the player.static voidsetReducedDebugInfo(net.minecraft.world.entity.player.Player internal, boolean reducedDebugInfo) Sets if the player has reduced debug info.static voidsetScore(net.minecraft.world.entity.player.Player internal, int score) Sets the score of the player.static voidstopSleeping(net.minecraft.world.entity.player.Player internal) Wakes up the player if they are sleepingstatic voidsweepAttack(net.minecraft.world.entity.player.Player internal) Spawns a sweep attack particle.
-
Constructor Details
-
ExpandPlayer
public ExpandPlayer()
-
-
Method Details
-
getAbilities
public static net.minecraft.world.entity.player.Abilities getAbilities(net.minecraft.world.entity.player.Player internal) Gets the abilities of the player.- Returns:
- The abilities of the player.
-
isSecondaryUseActive
public static boolean isSecondaryUseActive(net.minecraft.world.entity.player.Player internal) Checks if the secondary use is active, this usually means that the player is sneaking.- Returns:
- Whether the secondary use is active.
-
playNotifySound
public static void playNotifySound(net.minecraft.world.entity.player.Player internal, net.minecraft.sounds.SoundEvent event, net.minecraft.sounds.SoundSource source, float volume, float pitch) Plays a sound for the player.- Parameters:
event- The sound event to play.source- The source of the sound.volume- The volume of the sound.pitch- The pitch of the sound.
-
getScore
public static int getScore(net.minecraft.world.entity.player.Player internal) Gets the score of the player.- Returns:
- The score of the player.
-
setScore
public static void setScore(net.minecraft.world.entity.player.Player internal, int score) Sets the score of the player.- Parameters:
score- The score to set.
-
increaseScore
public static void increaseScore(net.minecraft.world.entity.player.Player internal, int score) Increases the score of the player.- Parameters:
score- The score to increase.
-
drop
public static net.minecraft.world.entity.item.ItemEntity drop(net.minecraft.world.entity.player.Player internal, net.minecraft.world.item.ItemStack stack, boolean traceItem) Drops an item in the world as if the player dropped it.- Parameters:
stack- The item to drop.traceItem- Whether to trace the item.- Returns:
- The item entity that was dropped.
-
getDestroySpeed
public static float getDestroySpeed(net.minecraft.world.entity.player.Player internal, net.minecraft.world.level.block.state.BlockState state) Gets the destroy speed of the player for a givenBlockState.- Parameters:
state- The block state to get the destroy speed for.- Returns:
- The destroy speed of the player for the given block state.
-
hasCorrectToolForDrops
public static boolean hasCorrectToolForDrops(net.minecraft.world.entity.player.Player internal, net.minecraft.world.level.block.state.BlockState state) Checks if the player has the correct tool for the givenBlockState.- Parameters:
state- The block state to check.- Returns:
- Whether the player has the correct tool for the given block state.
-
canHarmPlayer
public static boolean canHarmPlayer(net.minecraft.world.entity.player.Player internal, net.minecraft.world.entity.player.Player player) Checks if the player can harm another player. This does not check if pvp is enabled, it checks if players are on the same scoreboard team.- Parameters:
player- The player to check.- Returns:
- Whether the player can harm the other player.
-
attack
public static void attack(net.minecraft.world.entity.player.Player internal, net.minecraft.world.entity.Entity entity) Attacks an entity.- Parameters:
entity- The entity to attack.
-
disableShield
public static void disableShield(net.minecraft.world.entity.player.Player internal) Disables the shield of the player. -
crit
public static void crit(net.minecraft.world.entity.player.Player internal, net.minecraft.world.entity.Entity entity) Spawns critical hit particle at the hit entity.- Parameters:
entity- The entity to hit.
-
magicCrit
public static void magicCrit(net.minecraft.world.entity.player.Player internal, net.minecraft.world.entity.Entity entity) Spawns magic critical hit particle at the hit entity.- Parameters:
entity- The entity to hit.
-
sweepAttack
public static void sweepAttack(net.minecraft.world.entity.player.Player internal) Spawns a sweep attack particle. -
respawn
public static void respawn(net.minecraft.world.entity.player.Player internal) Respawns the player. -
isLocalPlayer
public static boolean isLocalPlayer(net.minecraft.world.entity.player.Player internal) Checks if the player is the local player.- Returns:
- Whether the player is the local player.
-
getInventory
public static net.minecraft.world.entity.player.Inventory getInventory(net.minecraft.world.entity.player.Player internal) Gets the inventory of the player.- Returns:
- The inventory of the player.
-
stopSleeping
public static void stopSleeping(net.minecraft.world.entity.player.Player internal) Wakes up the player if they are sleeping -
isSleepingLongEnough
public static boolean isSleepingLongEnough(net.minecraft.world.entity.player.Player internal) Checks if the player has been in bed long enough to trigger sleeping.- Returns:
- Whether the player has been sleeping long enough.
-
getSleepTimer
public static int getSleepTimer(net.minecraft.world.entity.player.Player internal) Gets the sleep timer of the player.- Returns:
- The sleep timer of the player.
-
displayClientMessage
public static void displayClientMessage(net.minecraft.world.entity.player.Player internal, net.minecraft.network.chat.Component component, boolean actionBar) Displays a message to the client.- Parameters:
component- The message to display.actionBar- Whether to display the message in the action bar.
-
awardStat
public static void awardStat(net.minecraft.world.entity.player.Player internal, net.minecraft.resources.ResourceLocation stat) Awards a stat to the player.- Parameters:
stat- The stat to award.
-
awardStat
public static void awardStat(net.minecraft.world.entity.player.Player internal, net.minecraft.resources.ResourceLocation stat, int amount) Awards a stat to the player.- Parameters:
stat- The stat to award.amount- The amount to award.
-
jumpFromGround
public static void jumpFromGround(net.minecraft.world.entity.player.Player internal) Makes the player jump from the ground. -
giveExperiencePoints
public static void giveExperiencePoints(net.minecraft.world.entity.player.Player internal, int amount) Gives the player experience points.- Parameters:
amount- The amount of experience to give.
-
getEnchantmentSeed
public static int getEnchantmentSeed(net.minecraft.world.entity.player.Player internal) Gets the enchantment seed of the player.- Returns:
- The enchantment seed of the player.
-
giveExperienceLevels
public static void giveExperienceLevels(net.minecraft.world.entity.player.Player internal, int levels) Gives the player experience levels.- Parameters:
levels- The amount of experience levels to give.
-
getXpNeededForNextLevel
public static int getXpNeededForNextLevel(net.minecraft.world.entity.player.Player internal) Gets the amount of experience needed to reach the next level.- Returns:
- The amount of experience needed to reach the next level.
-
getExperienceLevel
public static int getExperienceLevel(net.minecraft.world.entity.player.Player internal) Gets the experience level of the player.- Returns:
- The experience level of the player.
-
setExperienceLevel
public static void setExperienceLevel(net.minecraft.world.entity.player.Player internal, int level) Sets the experience level of the player.- Parameters:
level- The experience level to set.
-
causeFoodExhaustion
public static void causeFoodExhaustion(net.minecraft.world.entity.player.Player internal, float exhaustion) Adds food exhaustion to the player.- Parameters:
exhaustion- The amount of exhaustion to add.
-
getFoodData
public static net.minecraft.world.food.FoodData getFoodData(net.minecraft.world.entity.player.Player internal) Gets the food data of the player.- Returns:
- The food data of the player.
-
canEat
public static boolean canEat(net.minecraft.world.entity.player.Player internal, boolean ignoreHunger) Checks if the player can eat.- Parameters:
ignoreHunger- Whether to ignore hunger.- Returns:
- Whether the player can eat.
-
isHurt
public static boolean isHurt(net.minecraft.world.entity.player.Player internal) Checks if the player is hurt.- Returns:
- Whether the player is hurt.
-
mayBuild
public static boolean mayBuild(net.minecraft.world.entity.player.Player internal) Checks if the player may build.- Returns:
- Whether the player may build.
-
addItem
public static boolean addItem(net.minecraft.world.entity.player.Player internal, net.minecraft.world.item.ItemStack stack) Adds an item to the player's inventory.- Parameters:
stack- The item to add.- Returns:
- Whether the item was added.
-
setEntityOnShoulder
public static boolean setEntityOnShoulder(net.minecraft.world.entity.player.Player internal, MapData entityData) Sets an entity on the player's shoulder.- Parameters:
entityData- The entity data to set.- Returns:
- Whether the entity was set.
-
isCreative
public static boolean isCreative(net.minecraft.world.entity.player.Player internal) Checks if the player is creative.- Returns:
- Whether the player is creative.
-
isReducedDebugInfo
public static boolean isReducedDebugInfo(net.minecraft.world.entity.player.Player internal) Checks if the player has reduced debug info.- Returns:
- Whether the player has reduced debug info.
-
setReducedDebugInfo
public static void setReducedDebugInfo(net.minecraft.world.entity.player.Player internal, boolean reducedDebugInfo) Sets if the player has reduced debug info.- Parameters:
reducedDebugInfo- Whether the player has reduced debug info.
-
getMainArm
public static net.minecraft.world.entity.HumanoidArm getMainArm(net.minecraft.world.entity.player.Player internal) Gets the main arm of the player.- Returns:
- The main arm of the player.
-
setMainArm
public static void setMainArm(net.minecraft.world.entity.player.Player internal, net.minecraft.world.entity.HumanoidArm arm) Sets the main arm of the player.- Parameters:
arm- The arm to set.
-
getShoulderEntityLeft
Gets the entity on the player's left shoulder.- Returns:
- The entity on the player's left shoulder.
-
getShoulderEntityRight
Gets the entity on the player's right shoulder.- Returns:
- The entity on the player's right shoulder.
-
getCurrentItemAttackStrengthDelay
public static float getCurrentItemAttackStrengthDelay(net.minecraft.world.entity.player.Player internal) Gets the current item attack strength delay of the player.- Returns:
- The current item attack strength delay of the player.
-
getCooldowns
public static net.minecraft.world.item.ItemCooldowns getCooldowns(net.minecraft.world.entity.player.Player internal) Gets the cooldowns of the player.- Returns:
- The cooldowns of the player.
-
getLuck
public static float getLuck(net.minecraft.world.entity.player.Player internal) Gets the luck of the player.- Returns:
- The luck of the player.
-
canUseGameMasterBlocks
public static boolean canUseGameMasterBlocks(net.minecraft.world.entity.player.Player internal) Checks if the player can use game master blocks such as command blocks.- Returns:
- Whether the player can use game master blocks.
-
isScoping
public static boolean isScoping(net.minecraft.world.entity.player.Player internal) Checks if the player is scoping like when using a SpyGlass.- Returns:
- Whether the player is scoping.
-
give
public static void give(net.minecraft.world.entity.player.Player internal, IItemStack stack, int slot) Gives the player an item.- Parameters:
stack- The item to give.slot- The slot to give the item to.
-
sendMessage
public static void sendMessage(net.minecraft.world.entity.player.Player internal, net.minecraft.network.chat.Component text) Sends a message to the player.- Parameters:
text- The message to send.
-
isFakePlayer
public static boolean isFakePlayer(net.minecraft.world.entity.player.Player internal) Checks if this player is a fake player, mainly used for machines.- Returns:
- true if this is a fake player, false otherwise.
-