EntityNobody.java 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. package me.km.entities;
  2. import java.util.Collections;
  3. import net.minecraft.entity.Entity;
  4. import net.minecraft.entity.EntityType;
  5. import net.minecraft.entity.LivingEntity;
  6. import net.minecraft.inventory.EquipmentSlotType;
  7. import net.minecraft.item.ItemStack;
  8. import net.minecraft.util.DamageSource;
  9. import net.minecraft.util.HandSide;
  10. import net.minecraft.world.World;
  11. public class EntityNobody extends LivingEntity {
  12. public EntityNobody(EntityType<EntityNobody> type, World p_i48577_2_) {
  13. super(type, p_i48577_2_);
  14. }
  15. @Override
  16. public boolean attackEntityFrom(DamageSource source, float amount) {
  17. return false;
  18. }
  19. @Override
  20. public void applyKnockback(float strength, double ratioX, double ratioZ) {
  21. }
  22. @Override
  23. public void applyEntityCollision(Entity entityIn) {
  24. }
  25. @Override
  26. public void addVelocity(double x, double y, double z) {
  27. }
  28. @Override
  29. public Iterable<ItemStack> getArmorInventoryList() {
  30. return Collections.EMPTY_LIST;
  31. }
  32. @Override
  33. public ItemStack getItemStackFromSlot(EquipmentSlotType est) {
  34. return ItemStack.EMPTY;
  35. }
  36. @Override
  37. public void setItemStackToSlot(EquipmentSlotType est, ItemStack is) {
  38. }
  39. @Override
  40. public HandSide getPrimaryHand() {
  41. return HandSide.LEFT;
  42. }
  43. @Override
  44. public boolean canBeCollidedWith() {
  45. return false;
  46. }
  47. @Override
  48. protected void collideWithEntity(Entity entityIn) {
  49. }
  50. @Override
  51. public boolean isCustomNameVisible() {
  52. return true;
  53. }
  54. }