Jump to content

xCrazyFeline

Members
  • Posts

    10
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • URL
    https://modrinth.com/user/Felix
  • Location
    up ur nose (its not very pleasant)

Recent Profile Visitors

24083 profile views

xCrazyFeline's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I am unsure of what the best way to do this is. I have tried experimenting with making a custom version of the MoveToBlockGoal (and other methods such as moveTo) however, I am rather terrible with mob AI. If you know of a good way to do this (whether that is still mob AI or not), your assistance would be greatly appreciated. P.S.: My entity is not natively a PathfinderMob (or any type that can register goals) however, it can be easily changed to one.
  2. Can you post the class of the entity that's causing the crash? (And if you can the renderer and model classes too).
  3. That works! Thank you! I'll add your name to the mod's credits for your assistance. (I really can not thank you enough for this, I've been working on it for weeks, and it also helped me with something else I was going to have to fix)
  4. I have tried several different things in order to try to get where the player is looking at such as player.getLookAngle() (which now I realize doesn't have anything to do with that) and a few other methods that I can't remember right now, but the only thing I've found that works is getPlayerPOVHitResult, and that only works in children of the Item class. Currently, I'm trying to get an entity to spawn where the player is looking at 100 blocks in the air, and I have an item mostly set up to do so, but getPlayerPOVHitResult is not working in this situation. Here is exactly what I'm doing, if you know how to make this work properly your assistance would be highly appreciated: BlockHitResult povHitResult = getPlayerPOVHitResult(level, player, ClipContext.Fluid.ANY); if(!level.isClientSide && hand == InteractionHand.MAIN_HAND && !player.isCrouching() && mode == 6 && mode6) { DescendingShellEntity descendingShell = new DescendingShellEntity(TMEntityTypes.DESCENDING_SHELL.get(), level); descendingShell.setPos(povHitResult.getBlockPos().getX(), povHitResult.getBlockPos().getY() + 100, povHitResult.getBlockPos().getZ()); level.addFreshEntity(descendingShell); Here's the GitHub repo if it helps: https://github.com/xCrazyFeline/Turtle-Magic-1.19.2-FORGE-
  5. this.level or this.getLevel() should work in replacement for just level, else I'm not sure.
  6. Yeah, so that worked: for(LivingEntity livingentity : this.level.getEntitiesOfClass(LivingEntity.class, this.getBoundingBox())) { if(!(livingentity instanceof Player)) { this.push(livingentity); this.push(livingentity); this.push(livingentity); this.push(livingentity); } } I feel so stupid XD. Thanks for the help guys.
  7. Even then it would just not push any player instead of specifically the owner. (Also for some reason continue; didn't work. So that's wack: for(LivingEntity livingentity : this.level.getEntitiesOfClass(LivingEntity.class, this.getBoundingBox())) { if(livingentity == this.getOwner()) { continue; } this.push(livingentity); this.push(livingentity); this.push(livingentity); this.push(livingentity); } )
  8. Like this?: for(LivingEntity livingentity : this.level.getEntitiesOfClass(LivingEntity.class, this.getBoundingBox())) { if(!(livingentity instanceof ServerPlayer)) { this.push(livingentity); } } Because that didn't work (although I feel I executed what you said wrong).
  9. I also tried using this method: private void pushEntity(LivingEntity entity) { LivingEntity livingentity = this.getOwner(); if (entity.isAlive() && entity != livingentity) { if (livingentity.isAlliedTo(entity)) { return; } this.push(entity); this.push(entity); this.push(entity); this.push(entity); } } and calling it in tick(): for(LivingEntity livingentity : this.level.getEntitiesOfClass(LivingEntity.class, this.getBoundingBox())) { if(livingentity != this.getOwner()) { this.pushEntity(livingentity); } but it just says that livingentity is null.
  10. I've been trying to make an entity that sits around the player like a shield and pushes any other entity away, however, although I got the push part, it pushes the player too. I've tried messing around for a while, but have not figured anything out, so help would be highly appreciated. This is the code I'm using in the tick() method: for(LivingEntity livingentity : this.level.getEntitiesOfClass(LivingEntity.class, this.getBoundingBox())) { if(livingentity != this.getOwner()) { this.push(livingentity); this.push(livingentity); this.push(livingentity); this.push(livingentity); } }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.