Started by
gustavowizard123
on
Topic category: Help with Minecraft modding (Java Edition)
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
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???
on blockbench you set the display on the player model, just try it, you will love it.
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
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!
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