CamelHusk .java

net.minecraft.world.entity.animal.camel.CamelHusk (class, 134 lines): members: getDashingSound, getSitDownSound, getStandUpSound, getSaddleSound, canMate.

net.minecraft.world.entity.animal.camelclass134 linescommonextends Camel3.2 KB

API Surface (19)

boolean removeWhenFarAway(final double distSqr)
boolean isMobControlled()
InteractionResult interact(final Player player, final InteractionHand hand, final Vec3 location)
boolean canBeLeashed()
boolean isFood(final ItemStack itemStack)
SoundEvent getAmbientSound()
boolean canMate(final Animal partner)
boolean canFallInLove()
boolean canBeABaby()
SoundEvent getDeathSound()
SoundEvent getHurtSound(final DamageSource source)
void playStepSound(final BlockPos pos, final BlockState blockState)
SoundEvent getDashingSound()
SoundEvent getDashReadySound()
SoundEvent getEatingSound()
SoundEvent getStandUpSound()
SoundEvent getSitDownSound()
Holder.Reference<SoundEvent> getSaddleSound()
float chargeSpeedModifier()

Same Package (3)

Full Source

CamelHusk.java134 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.entity.animal.camel;
2
3
import net.minecraft.core.BlockPos;
4
import net.minecraft.core.Holder;
5
import net.minecraft.server.level.ServerLevel;
6
import net.minecraft.sounds.SoundEvent;
7
import net.minecraft.sounds.SoundEvents;
8
import net.minecraft.tags.BlockTags;
9
import net.minecraft.tags.ItemTags;
10
import net.minecraft.world.InteractionHand;
11
import net.minecraft.world.InteractionResult;
12
import net.minecraft.world.damagesource.DamageSource;
13
import net.minecraft.world.entity.AgeableMob;
14
import net.minecraft.world.entity.EntityType;
15
import net.minecraft.world.entity.Mob;
16
import net.minecraft.world.entity.animal.Animal;
17
import net.minecraft.world.entity.player.Player;
18
import net.minecraft.world.item.ItemStack;
19
import net.minecraft.world.level.Level;
20
import net.minecraft.world.level.block.state.BlockState;
21
import net.minecraft.world.phys.Vec3;
22
import org.jspecify.annotations.Nullable;
23
24
public class CamelHusk extends Camel {
25
	public CamelHusk(final EntityType<? extends Camel> type, final Level level) {
26
		super(type, level);
27
	}
28
29
	@Override
30
	public boolean removeWhenFarAway(final double distSqr) {
31
		return true;
32
	}
33
34
	@Override
35
	public boolean isMobControlled() {
36
		return this.getFirstPassenger() instanceof Mob;
37
	}
38
39
	@Override
40
	public InteractionResult interact(final Player player, final InteractionHand hand, final Vec3 location) {
41
		this.setPersistenceRequired();
42
		return super.interact(player, hand, location);
43
	}
44
45
	@Override
46
	public boolean canBeLeashed() {
47
		return !this.isMobControlled();
48
	}
49
50
	@Override
51
	public boolean isFood(final ItemStack itemStack) {
52
		return itemStack.is(ItemTags.CAMEL_HUSK_FOOD);
53
	}
54
55
	@Override
56
	protected SoundEvent getAmbientSound() {
57
		return SoundEvents.CAMEL_HUSK_AMBIENT;
58
	}
59
60
	@Override
61
	public boolean canMate(final Animal partner) {
62
		return false;
63
	}
64
65
	@Override
66
	public @Nullable Camel getBreedOffspring(final ServerLevel level, final AgeableMob partner) {
67
		return null;
68
	}
69
70
	@Override
71
	public boolean canFallInLove() {
72
		return false;
73
	}
74
75
	@Override
76
	public boolean canBeABaby() {
77
		return false;
78
	}
79
80
	@Override
81
	protected SoundEvent getDeathSound() {
82
		return SoundEvents.CAMEL_HUSK_DEATH;
83
	}
84
85
	@Override
86
	protected SoundEvent getHurtSound(final DamageSource source) {
87
		return SoundEvents.CAMEL_HUSK_HURT;
88
	}
89
90
	@Override
91
	protected void playStepSound(final BlockPos pos, final BlockState blockState) {
92
		if (blockState.is(BlockTags.CAMEL_SAND_STEP_SOUND_BLOCKS)) {
93
			this.playSound(SoundEvents.CAMEL_HUSK_STEP_SAND, 0.4F, 1.0F);
94
		} else {
95
			this.playSound(SoundEvents.CAMEL_HUSK_STEP, 0.4F, 1.0F);
96
		}
97
	}
98
99
	@Override
100
	protected SoundEvent getDashingSound() {
101
		return SoundEvents.CAMEL_HUSK_DASH;
102
	}
103
104
	@Override
105
	protected SoundEvent getDashReadySound() {
106
		return SoundEvents.CAMEL_HUSK_DASH_READY;
107
	}
108
109
	@Override
110
	protected SoundEvent getEatingSound() {
111
		return SoundEvents.CAMEL_HUSK_EAT;
112
	}
113
114
	@Override
115
	protected SoundEvent getStandUpSound() {
116
		return SoundEvents.CAMEL_HUSK_STAND;
117
	}
118
119
	@Override
120
	protected SoundEvent getSitDownSound() {
121
		return SoundEvents.CAMEL_HUSK_SIT;
122
	}
123
124
	@Override
125
	protected Holder.Reference<SoundEvent> getSaddleSound() {
126
		return SoundEvents.CAMEL_HUSK_SADDLE;
127
	}
128
129
	@Override
130
	public float chargeSpeedModifier() {
131
		return 4.0F;
132
	}
133
}
134

Decompiled Minecraft 26.3 source of CamelHusk (net/minecraft/world/entity/animal/camel/CamelHusk.java) with Mojang official mappings, stored verbatim on the site.