Stop 'Replace Item in Hand' "animation"

Started by gustavowizard123 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Sep 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Stop 'Replace Item in Hand' "animation"

so i notice when you use the procedure 'replace item in main hand', there is a animation and a sound (the item kinda go down and back up), i open the procedure code here, is there a way to turn OFF that animation?

Entity entity = (Entity) dependencies.get("entity");
		double x = dependencies.get("x") instanceof Integer ? (int) dependencies.get("x") : (double) dependencies.get("x");
		double y = dependencies.get("y") instanceof Integer ? (int) dependencies.get("y") : (double) dependencies.get("y");
		double z = dependencies.get("z") instanceof Integer ? (int) dependencies.get("z") : (double) dependencies.get("z");
		IWorld world = (IWorld) dependencies.get("world");
		if (((world.getEntitiesWithinAABB(CreeperEntity.class,
				new AxisAlignedBB(x - 20 / 2, y - 20 / 2, z - 20 / 2, x + 20 / 2, y + 20 / 2, z + 20 / 2), null).stream()
				.sorted(Comparator.comparing(_ent -> _ent.getDistanceSq(x, y, z))).findFirst().orElse(null)) != null)) {
			if (entity instanceof LivingEntity) {
				ItemStack _setstack = new ItemStack(LifeDetectorONItem.block, (int) (1));
				_setstack.setCount((int) 1);
				((LivingEntity) entity).setHeldItem(Hand.MAIN_HAND, _setstack);
				if (entity instanceof ServerPlayerEntity)
					((ServerPlayerEntity) entity).inventory.markDirty();
			}
			if (((entity.getPersistentData().getDouble("lifedetectortick")) < 21)) {
				entity.getPersistentData().putDouble("lifedetectortick", ((entity.getPersistentData().getDouble("lifedetectortick")) + 1));
			} else {
				entity.getPersistentData().putDouble("lifedetectortick", 0);
			}
			if (((entity.getPersistentData().getDouble("lifedetectortick")) == 10)) {
				world.playSound(world.getWorld().isRemote ? Minecraft.getInstance().player : (PlayerEntity) null, new BlockPos(x, y, z),
						(net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("wizardtech:beep_detect")),
						SoundCategory.NEUTRAL, (float) 1, (float) 1);
			}
		} else {
			entity.getPersistentData().putDouble("lifedetectortick", 0);
		}

thanks in advance

Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
yes. But I want the hand to…
Wed, 08/05/2020 - 14:21

yes. But I want the hand to not move at all in any view except maybe bring up the weapon when it fires and not be swinging around in any view while firing. Its been a pain to try to figure out. I know that Mrcrayfish's gun mod creator thing is another option, but I don't want to download another software unless I need to badly. >_<. Why???

Joined Sep 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
on blockbench you set the…
Wed, 08/05/2020 - 23:25

on blockbench you set the display on the player model, just try it, you will love it.

Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
like adjust it the way I…
Wed, 08/05/2020 - 23:58

like adjust it the way I want it to appear on the character? yeah, it's great actually. I just had a thought, when I right-click to fire the gun and hold it, your character is doing either the breaking or placing animation. it's trying to place down the weapon. i need to look through my mod's code again and see if there is anyway to disable placing movement when a certain item is in your active hand

Joined Sep 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
yeah something like that…
Thu, 08/06/2020 - 23:53

yeah something like that... but i was wondering where is this code, cause i cant see it on Item code or Procedure code :/

let me know if you find anything.. thanks again!

Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
no problem! I do see a new…
Fri, 08/07/2020 - 00:02

no problem! I do see a new procedure that is involving the main hand and the off-hand. I'm not sure if its one of the MCreator plugins or the new update released for MCreator