Jump to content

Recommended Posts

Posted

Hi !

Can someone help how to create entity with sword for 1.15.2 ?

Spoiler

package com.lsn.bestiaria.entities;

import com.lsn.bestiaria.init.SoundInit;

import net.minecraft.entity.EntityType;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.goal.NearestAttackableTargetGoal;
import net.minecraft.entity.ai.goal.SwimGoal;
import net.minecraft.entity.ai.goal.WaterAvoidingRandomWalkingGoal;
import net.minecraft.entity.merchant.villager.AbstractVillagerEntity;
import net.minecraft.entity.monster.MonsterEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.EquipmentSlotType;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.util.SoundEvent;
import net.minecraft.world.DifficultyInstance;
import net.minecraft.world.World;

public class Ratoner extends MonsterEntity
{
	public Ratoner(EntityType<? extends MonsterEntity> type, World p_i48553_2_) 
	{
		super(type, p_i48553_2_);
	}
	@Override
	protected void registerGoals() 
	{
		super.registerGoals();
	    this.applyEntityAI();
	    this.goalSelector.addGoal(2, new RatonerAttackGoal(this, 1.0D, false));
		this.goalSelector.addGoal(0, new SwimGoal(this));
	}

	protected void applyEntityAI() {
	      this.goalSelector.addGoal(7, new WaterAvoidingRandomWalkingGoal(this, 0.6D));
	      this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, PlayerEntity.class, true));
	      this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, AbstractVillagerEntity.class, false));
	} 
	
	@Override
	protected void registerAttributes () {
		super.registerAttributes();
		this.getAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(15.0D);
		this.getAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.3D);
	    this.getAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(40.0D);
	    this.getAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(3.0D);
	    this.getAttribute(SharedMonsterAttributes.ARMOR).setBaseValue(4.0D);
		   }  
	@Override
	protected SoundEvent getAmbientSound() {
		return SoundInit.AMBIENT.get();
	}
	@Override
	protected void setEquipmentBasedOnDifficulty(DifficultyInstance difficulty) 
	{
		      this.setItemStackToSlot(EquipmentSlotType.MAINHAND, new ItemStack(Items.IRON_SWORD));
	}
}

 

Spoiler

package com.lsn.bestiaria.client.entity.model;

import com.lsn.bestiaria.entities.Ratoner;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.vertex.IVertexBuilder;

import net.minecraft.client.renderer.entity.model.EntityModel;
import net.minecraft.client.renderer.entity.model.IHasArm;
import net.minecraft.client.renderer.entity.model.IHasHead;
import net.minecraft.client.renderer.model.ModelRenderer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Hand;
import net.minecraft.util.HandSide;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

public class RatonerModel<T extends Ratoner> extends EntityModel<T> implements IHasArm, IHasHead{
	public RatonerModel.ArmPose leftArmPose = RatonerModel.ArmPose.EMPTY;
	public RatonerModel.ArmPose rightArmPose = RatonerModel.ArmPose.EMPTY;
	
	private final ModelRenderer Body;
	private final ModelRenderer bodymid;
	private final ModelRenderer Bodyup;
	private final ModelRenderer Head;
	private final ModelRenderer Mouthr;
	private final ModelRenderer MouthL;
	private final ModelRenderer Mouthdown;
	private final ModelRenderer Hair;
	private final ModelRenderer EarRight;
	private final ModelRenderer EarLeft;
	private final ModelRenderer Mouth;
	private final ModelRenderer mouthA;
	private final ModelRenderer Nose;
	private final ModelRenderer ArmLeft;
	private final ModelRenderer Arml;
	private final ModelRenderer handl;
	private final ModelRenderer ArmRight;
	private final ModelRenderer Armr;
	private final ModelRenderer handr;
	private final ModelRenderer RLeg;
	private final ModelRenderer legr;
	private final ModelRenderer legrdown;
	private final ModelRenderer bone2;
	private final ModelRenderer LLeg;
	private final ModelRenderer legl;
	private final ModelRenderer legldown;
	private final ModelRenderer bone;
	private final ModelRenderer Tale;
	private final ModelRenderer Tale2;
	private final ModelRenderer Tale3;
	private final ModelRenderer Tale4;
	private final ModelRenderer Tale5;

	public RatonerModel() {
		textureWidth = 64;
		textureHeight = 64;

		Body = new ModelRenderer(this);
		Body.setRotationPoint(0.0F, 14.0F, 0.0F);
		Body.setTextureOffset(9, 16).addBox(-3.0F, -0.5F, -2.0F, 6, 4, 4, 0.0F, false);
		
		bodymid = new ModelRenderer(this);
		bodymid.setRotationPoint(0.0F, -2.0F, 0.0F);
		Body.addChild(bodymid);
		bodymid.setTextureOffset(12, 8).addBox(-2.5F, -1.0F, -1.5F, 5, 3, 3, 0.0F, false);
		
		Bodyup = new ModelRenderer(this);
		Bodyup.setRotationPoint(0.0F, -1.0F, 0.0F);
		setRotationAngle(Bodyup, 0.2618F, 0.0F, 0.0F);
		bodymid.addChild(Bodyup);
		Bodyup.setTextureOffset(9, 0).addBox(-3.0F, -2.4659F, -2.0412F, 6, 3, 4, 0.0F, false);
		
		Head = new ModelRenderer(this);
		Head.setRotationPoint(0.0F, -1.9659F, -0.7412F);
		setRotationAngle(Head, -0.2618F, 0.0F, 0.0F);
		Bodyup.addChild(Head);
		Head.setTextureOffset(30, 0).addBox(-2.0F, -3.0F, -2.0F, 4, 3, 3, 0.0F, false);
		
		Mouthr = new ModelRenderer(this);
		Mouthr.setRotationPoint(0.0F, 0.0F, -1.0F);
		setRotationAngle(Mouthr, 0.3491F, -0.2618F, 0.0F);
		Head.addChild(Mouthr);
		Mouthr.setTextureOffset(56, 33).addBox(-1.4F, -0.8341F, -3.2588F, 1, 1, 3, 0.0F, false);
		
		MouthL = new ModelRenderer(this);
		MouthL.setRotationPoint(0.0F, 0.0F, -1.0F);
		setRotationAngle(MouthL, 0.3491F, 0.2618F, 0.0F);
		Head.addChild(MouthL);
		MouthL.setTextureOffset(47, 32).addBox(0.4F, -0.8341F, -3.2588F, 1, 1, 3, 0.0F, false);
		
		Mouthdown = new ModelRenderer(this);
		Mouthdown.setRotationPoint(0.0F, 0.0F, -1.0F);
		setRotationAngle(Mouthdown, 0.3491F, 0.0F, 0.0F);
		Head.addChild(Mouthdown);
		Mouthdown.setTextureOffset(58, 39).addBox(-0.5F, 0.1659F, -2.2588F, 1, 0, 2, 0.0F, false);
		
		Hair = new ModelRenderer(this);
		Hair.setRotationPoint(0.0F, 0.0F, 0.0F);
		Head.addChild(Hair);
		Hair.setTextureOffset(56, 0).addBox(0.0F, -4.5F, -2.499F, 0, 4, 4, 0.0F, false);
		
		EarRight = new ModelRenderer(this);
		EarRight.setRotationPoint(-2.0F, -2.0F, 0.0F);
		setRotationAngle(EarRight, 0.0F, 0.7854F, 0.2618F);
		Head.addChild(EarRight);
		EarRight.setTextureOffset(46, 0).addBox(-3.0F, -2.0F, 0.0F, 3, 2, 0, 0.0F, false);
		
		EarLeft = new ModelRenderer(this);
		EarLeft.setRotationPoint(2.0F, -2.0F, 0.0F);
		setRotationAngle(EarLeft, 0.0F, -0.7854F, -0.2618F);
		Head.addChild(EarLeft);
		EarLeft.setTextureOffset(46, 2).addBox(0.0F, -2.0F, 0.0F, 3, 2, 0, 0.0F, false);
		
		Mouth = new ModelRenderer(this);
		Mouth.setRotationPoint(0.0F, -2.0F, -2.0F);
		setRotationAngle(Mouth, 0.0873F, 0.0F, 0.0F);
		Head.addChild(Mouth);
		Mouth.setTextureOffset(30, 7).addBox(-1.5F, 0.0F, -2.0F, 3, 2, 2, 0.0F, false);
		
		mouthA = new ModelRenderer(this);
		mouthA.setRotationPoint(1.0F, 1.0F, -1.0F);
		setRotationAngle(mouthA, 0.0873F, 0.0F, 0.0F);
		Mouth.addChild(mouthA);
		mouthA.setTextureOffset(30, 12).addBox(-2.0F, 0.0F, -2.0F, 2, 1, 1, 0.0F, false);
		
		Nose = new ModelRenderer(this);
		Nose.setRotationPoint(-1.0F, 0.0F, -2.0F);
		setRotationAngle(Nose, 0.1745F, 0.0F, 0.0F);
		mouthA.addChild(Nose);
		Nose.setTextureOffset(30, 15).addBox(-0.5F, 0.0F, -1.0F, 1, 1, 1, 0.0F, false);
		
		ArmLeft = new ModelRenderer(this);
		ArmLeft.setRotationPoint(3.0F, -0.9659F, -0.7412F);
		setRotationAngle(ArmLeft, -0.0873F, 0.0F, -0.3491F);
		Bodyup.addChild(ArmLeft);
		ArmLeft.setTextureOffset(0, 0).addBox(-0.0937F, -0.8506F, -0.9247F, 2, 6, 2, 0.0F, true);
		
		Arml = new ModelRenderer(this);
		Arml.setRotationPoint(0.9063F, 5.1494F, 1.0753F);
		setRotationAngle(Arml, 0.3491F, 0.0F, 0.1745F);
		ArmLeft.addChild(Arml);
		Arml.setTextureOffset(0, 8).addBox(-0.5F, -0.925F, -5.1318F, 1, 1, 5, 0.0F, false);
		
		handl = new ModelRenderer(this);
		handl.setRotationPoint(0.0937F, -0.1835F, -4.3341F);
		Arml.addChild(handl);
		handl.setTextureOffset(0, 16).addBox(-1.0937F, -1.3165F, -1.6659F, 2, 2, 2, 0.0F, true);
		
		ArmRight = new ModelRenderer(this);
		ArmRight.setRotationPoint(-3.0F, -0.9659F, -0.7412F);
		setRotationAngle(ArmRight, -0.0873F, 0.0F, 0.3491F);
		Bodyup.addChild(ArmRight);
		ArmRight.setTextureOffset(0, 0).addBox(-1.9063F, -0.8506F, -0.9247F, 2, 6, 2, 0.0F, false);
		
		Armr = new ModelRenderer(this);
		Armr.setRotationPoint(-0.9063F, 5.1494F, 1.0753F);
		setRotationAngle(Armr, 0.3491F, 0.0F, -0.1745F);
		ArmRight.addChild(Armr);
		Armr.setTextureOffset(0, 8).addBox(-0.5F, -0.925F, -5.1318F, 1, 1, 5, 0.0F, true);
		
		handr = new ModelRenderer(this);
		handr.setRotationPoint(-0.0937F, -0.1835F, -4.3341F);
		Armr.addChild(handr);
		handr.setTextureOffset(0, 16).addBox(-1.0937F, -1.3165F, -1.6659F, 2, 2, 2, 0.0F, false);
		
		RLeg = new ModelRenderer(this);
		RLeg.setRotationPoint(-2.0F, 5.0F, 0.0F);
		setRotationAngle(RLeg, 2.2689F, 3.1416F, 0.0F);
		bodymid.addChild(RLeg);
		RLeg.setTextureOffset(0, 57).addBox(-0.999F, -1.3963F, -4.5837F, 2, 2, 5, 0.0F, false);
		
		legr = new ModelRenderer(this);
		legr.setRotationPoint(0.0F, 0.234F, -4.3572F);
		setRotationAngle(legr, 3.1416F, 0.0F, 0.0F);
		RLeg.addChild(legr);
		legr.setTextureOffset(14, 51).addBox(-0.5F, -0.7324F, -0.3F, 1, 4, 2, 0.0F, false);
		
		legrdown = new ModelRenderer(this);
		legrdown.setRotationPoint(0.0F, 3.1902F, -0.6288F);
		setRotationAngle(legrdown, -0.3491F, 3.1416F, 0.0F);
		legr.addChild(legrdown);
		legrdown.setTextureOffset(21, 41).addBox(-0.501F, -1.1069F, -1.4715F, 1, 1, 3, 0.0F, false);
		
		bone2 = new ModelRenderer(this);
		bone2.setRotationPoint(0.0F, 0.0F, -2.0F);
		setRotationAngle(bone2, 1.0472F, 0.0F, 0.0F);
		legrdown.addChild(bone2);
		bone2.setTextureOffset(0, 27).addBox(-1.0F, 0.0F, -1.314F, 2, 3, 1, 0.0F, true);

		LLeg = new ModelRenderer(this);
		LLeg.setRotationPoint(2.0F, 5.0F, 0.0F);
		setRotationAngle(LLeg, 2.2689F, 3.1416F, 0.0F);
		bodymid.addChild(LLeg);
		LLeg.setTextureOffset(0, 49).addBox(-0.999F, -1.3963F, -4.5837F, 2, 2, 5, 0.0F, false);
		
		legl = new ModelRenderer(this);
		legl.setRotationPoint(0.0F, 0.234F, -4.3572F);
		setRotationAngle(legl, 3.1416F, 0.0F, 0.0F);
		LLeg.addChild(legl);
		legl.setTextureOffset(14, 51).addBox(-0.5F, -0.7324F, -0.3F, 1, 4, 2, 0.0F, false);
		
		legldown = new ModelRenderer(this);
		legldown.setRotationPoint(0.0F, 3.1902F, -0.6288F);
		setRotationAngle(legldown, -0.3491F, 3.1416F, 0.0F);
		legl.addChild(legldown);
		legldown.setTextureOffset(21, 49).addBox(-0.501F, -1.1069F, -1.4715F, 1, 1, 3, 0.0F, false);
		
		bone = new ModelRenderer(this);
		bone.setRotationPoint(0.0F, 0.0F, -2.0F);
		setRotationAngle(bone, 1.0472F, 0.0F, 0.0F);
		legldown.addChild(bone);
		bone.setTextureOffset(0, 27).addBox(-1.0F, 0.0F, -1.314F, 2, 3, 1, 0.0F, false);
		
		Tale = new ModelRenderer(this);
		Tale.setRotationPoint(0.0F, 3.0F, 2.0F);
		setRotationAngle(Tale, -0.8727F, 0.0F, 0.0F);
		bodymid.addChild(Tale);
		Tale.setTextureOffset(52, 59).addBox(-1.5F, 0.0F, 0.0F, 3, 2, 3, 0.0F, false);
		
		Tale2 = new ModelRenderer(this);
		Tale2.setRotationPoint(0.0F, 0.0F, 3.0F);
		setRotationAngle(Tale2, -0.4363F, 0.0F, 0.0F);
		Tale.addChild(Tale2);
		Tale2.setTextureOffset(56, 53).addBox(-1.0F, 0.0F, 0.0F, 2, 2, 2, 0.0F, false);

		Tale3 = new ModelRenderer(this);
		Tale3.setRotationPoint(0.0F, 2.0F, 2.0F);
		setRotationAngle(Tale3, 0.2618F, 0.0F, 0.0F);
		Tale2.addChild(Tale3);
		Tale3.setTextureOffset(58, 48).addBox(-0.999F, -1.9924F, -0.1743F, 2, 2, 2, 0.0F, false);
		
		Tale4 = new ModelRenderer(this);
		Tale4.setRotationPoint(0.0F, -0.4924F, 1.8257F);
		setRotationAngle(Tale4, 0.3491F, 0.0F, 0.0F);
		Tale3.addChild(Tale4);
		Tale4.setTextureOffset(58, 44).addBox(-0.5F, -1.0F, 0.0F, 1, 1, 2, 0.0F, false);
		
		Tale5 = new ModelRenderer(this);
		Tale5.setRotationPoint(0.0F, 0.0F, 2.0F);
		setRotationAngle(Tale5, 0.6109F, 0.0F, 0.0F);
		Tale4.addChild(Tale5);
		Tale5.setTextureOffset(43, 60).addBox(-0.499F, -1.0076F, 0.0F, 1, 1, 3, 0.0F, false);
	}

	public void render(MatrixStack matrixStackIn, IVertexBuilder bufferIn, int packedLightIn, int packedOverlayIn,
			float red, float green, float blue, float alpha) {
		Body.render(matrixStackIn, bufferIn, packedLightIn, packedOverlayIn, red, green, blue, alpha);
	}

	public void setRotationAngles(T entityIn, float limbSwing, float limbSwingAmount, float ageInTicks,
			float netHeadYaw, float headPitch) {
	      float f = 1.0F;
	      if (f < 1.0F) {
	         f = 1.0F;
	      }

	      this.Head.rotateAngleY = netHeadYaw * ((float)Math.PI / 180F);
	      this.Head.rotateAngleX = headPitch * ((float)Math.PI / 180F);

	      this.handr.rotateAngleY = 0.0F;
	      this.handl.rotateAngleZ = 0.0F;
	      switch(this.leftArmPose) {
	      case EMPTY:
	         this.handl.rotateAngleY = 0.0F;
	         break;
	      case BLOCK:
	         this.handl.rotateAngleX = this.handl.rotateAngleX * 0.5F - 0.9424779F;
	         this.handl.rotateAngleY = ((float)Math.PI / 6F);
	         break;
	      case ITEM:
	         this.handl.rotateAngleX = this.handl.rotateAngleX * 0.5F - ((float)Math.PI / 10F);
	         this.handl.rotateAngleY = 0.0F;
		default:
			break;
	      }

	      switch(this.rightArmPose) {
	      case EMPTY:
	         this.handr.rotateAngleY = 0.0F;
	         break;
	      case BLOCK:
	         this.handr.rotateAngleX = this.handr.rotateAngleX * 0.5F - 0.9424779F;
	         this.handr.rotateAngleY = (-(float)Math.PI / 6F);
	         break;
	      case ITEM:
	         this.handr.rotateAngleX = this.handr.rotateAngleX * 0.5F - ((float)Math.PI / 10F);
	         this.handr.rotateAngleY = 0.0F;
	         break;
	      case THROW_SPEAR:
	         this.handr.rotateAngleX = this.handr.rotateAngleX * 0.5F - (float)Math.PI;
	         this.handr.rotateAngleY = 0.0F;
		default:
			break;
	      }
	      if (this.leftArmPose == RatonerModel.ArmPose.THROW_SPEAR && this.rightArmPose != RatonerModel.ArmPose.BLOCK && this.rightArmPose != RatonerModel.ArmPose.THROW_SPEAR && this.rightArmPose != RatonerModel.ArmPose.BOW_AND_ARROW) {
	          this.handl.rotateAngleX = this.handl.rotateAngleX * 0.5F - (float)Math.PI;
	          this.handl.rotateAngleY = 0.0F;
	       }
	}
	public void setRotationAngle(ModelRenderer modelRenderer, float x, float y, float z) {
		modelRenderer.rotateAngleX = x;
		modelRenderer.rotateAngleY = y;
		modelRenderer.rotateAngleZ = z;
	}
	/**for items in hand(don't work):*/
	@Override
	 public void setLivingAnimations(T entityIn, float limbSwing, float limbSwingAmount, float partialTick) {
	      this.rightArmPose = RatonerModel.ArmPose.EMPTY;
	      this.leftArmPose = RatonerModel.ArmPose.EMPTY;
	      ItemStack itemstack = entityIn.getHeldItem(Hand.MAIN_HAND);
	      if (itemstack.getItem() instanceof net.minecraft.item.BowItem && entityIn.isAggressive()) {
	         if (entityIn.getPrimaryHand() == HandSide.RIGHT) {
	            this.rightArmPose = RatonerModel.ArmPose.BOW_AND_ARROW;
	         } else {
	            this.leftArmPose = RatonerModel.ArmPose.BOW_AND_ARROW;
	         }
	      }

	      super.setLivingAnimations(entityIn, limbSwing, limbSwingAmount, partialTick);
	   }
	@Override
	public ModelRenderer getModelHead() {
		return this.Head;
	}

	@Override
	public void translateHand(HandSide sideIn, MatrixStack matrixStackIn) {
		 float f = sideIn == HandSide.RIGHT ? 1.0F : -1.0F;
	      ModelRenderer modelrenderer = this.getArmForSide(sideIn);
	      modelrenderer.rotationPointX += f;
	      modelrenderer.translateRotate(matrixStackIn);
	      modelrenderer.rotationPointX -= f;
	}
	   public void setModelAttributes(RatonerModel<T> modelIn) {
		      super.copyModelAttributesTo(modelIn);
		      modelIn.leftArmPose = this.leftArmPose;
		      modelIn.rightArmPose = this.leftArmPose;
		   }
	protected ModelRenderer getArmForSide(HandSide side) {
	      return side == HandSide.LEFT ? this.handl : this.handr;
	   }
	protected HandSide getMainHand(T entityIn) {
	      HandSide handside = entityIn.getPrimaryHand();
	      return entityIn.swingingHand == Hand.MAIN_HAND ? handside : handside.opposite();
	   }
	   @OnlyIn(Dist.CLIENT)
	   public static enum ArmPose {
	      EMPTY,
	      ITEM,
	      BLOCK,
	      BOW_AND_ARROW,
	      THROW_SPEAR,
	      CROSSBOW_CHARGE,
	      CROSSBOW_HOLD;
	   }
}

 

 

 

Posted

Take a look at vanilla code, maybe wither skeletons as they always have a sword (I think?). Zombies also can wield swords, so looking at the code for them might help you too. :)

Posted
10 hours ago, Ugdhar said:

Take a look at vanilla code, maybe wither skeletons as they always have a sword (I think?). Zombies also can wield swords, so looking at the code for them might help you too. :)

I already copy wither skeletons code and skeleton and biped model but its no use :(

 

Posted
21 minutes ago, LegoSuperNik said:

I already copy wither skeletons code and skeleton and biped model but its no use :(

 

Define “no use”. Does it crash? Does your entity not appear?

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

Posted (edited)
3 minutes ago, DavidM said:

Define “no use”. Does it crash? Does your entity not appear?

Entity summon with textures but without sword

Edited by LegoSuperNik
Posted

You should always show what you tried. Best way to share code is to host your project on github as a buildable project, so others can look at it (and see the whole picture), as well as build/debug it if desired. Also make sure there's nothing in the debug.log that's giving you more information.

Posted (edited)
1 hour ago, Ugdhar said:

You should always show what you tried. Best way to share code is to host your project on github as a buildable project, so others can look at it (and see the whole picture), as well as build/debug it if desired. Also make sure there's nothing in the debug.log that's giving you more information.

https://github.com/LegoSuperNik/Bestiaria

P.S.   Entity Monster its full copy of wither skeleton

Edited by LegoSuperNik
Posted
17 minutes ago, LegoSuperNik said:

https://github.com/LegoSuperNik/Bestiaria

P.S.   Entity Monster its full copy of wither skeleton

Ok, so what have you tried, besides just copying stuff?

Looking at it, I don't see any mention of a sword anywhere, but lots of stuff about bow & arrow, so that looks like a good place to start.

I haven't done this before, I just know how to code and look for stuff, so I can't tell you EXACTLY how to do it, you're going to have to use some skills yourself. :)

Posted
3 hours ago, Ugdhar said:

Ok, so what have you tried, besides just copying stuff?

Looking at it, I don't see any mention of a sword anywhere, but lots of stuff about bow & arrow, so that looks like a good place to start.

I haven't done this before, I just know how to code and look for stuff, so I can't tell you EXACTLY how to do it, you're going to have to use some skills yourself. :)

I try to change bow to sword or item but its not help . I change code more 5 times but its also don't help :(

Posted
Just now, LegoSuperNik said:

I try to change bow to sword or item but its not help . I change code more 5 times but its also don't help :(

Then what you need to do, is when you try something and it doesn't work, come back here, explain what you tried, with either links to the code on your github, or at least a mention of which classes/where you changed it.

Explain what did not work, and post logs, even if the game doesn't crash, sometimes there's stuff in there that helps find what's going wrong.

And of course, the more Java/programming you know, and the longer you've done it, the easier it will be.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • When i start my game with a shader active the game crashes with this Error: java.lang.NoSuchFieldError: TESSELATION_SHADERS Minecraft java 1.20.1 in forge 47.4.0 crash report in pastebin: https://pastebin.com/6xiwHqZW thanks in advance
    • If you are using AMD/ATI, update your drivers - get the drivers from their website - do not update via system
    • Not sure why this is happening, but I would love some help. The reason I restarted the server was because I was getting an error while trying to join regarding this "Internal Exception: io.netty.handler.codec.DecoderException: io.netty.handler.codec.EncoderException: java.io.IOException: Root tag must be a named compound tag" Im using ServerMiner if thats any help
    • [13-05-2025 02:20:01]    |-- fabric-renderer-registries-v1 3.2.25+df3654b390 [13-05-2025 02:20:01]    |-- fabric-rendering-data-attachment-v1 0.3.19+6e0787e690 [13-05-2025 02:20:01]    |-- fabric-rendering-fluids-v1 3.0.11+4d0d570390 [13-05-2025 02:20:01]    |-- fabric-rendering-v0 1.1.28+df3654b390 [13-05-2025 02:20:01]    |-- fabric-rendering-v1 1.13.0+526f2c6790 [13-05-2025 02:20:01]    |-- fabric-resource-conditions-api-v1 2.1.2+aae9039d90 [13-05-2025 02:20:01]    |-- fabric-resource-loader-v0 0.8.4+edbdcddb90 [13-05-2025 02:20:01]    |-- fabric-screen-api-v1 1.0.32+4d0d570390 [13-05-2025 02:20:01]    |-- fabric-screen-handler-api-v1 1.3.8+1cc24b1b90 [13-05-2025 02:20:01]    |-- fabric-sound-api-v1 1.0.2+c4f28df590 [13-05-2025 02:20:01]    |-- fabric-textures-v0 1.0.24+aeb40ebe90 [13-05-2025 02:20:01]    |-- fabric-transfer-api-v1 2.1.6+413cbbc790 [13-05-2025 02:20:01]    \-- fabric-transitive-access-wideners-v1 1.3.3+08b73de490 [13-05-2025 02:20:01] - fabricloader 0.16.14 [13-05-2025 02:20:01]    \-- mixinextras 0.4.1 [13-05-2025 02:20:01] - geckolib3 3.1.40 [13-05-2025 02:20:01]    \-- com_eliotlash_mclib_mclib 20 [13-05-2025 02:20:01] - genesis 1.19.2-1.0.2 [13-05-2025 02:20:01] - grounded_origins 1.2.3 [13-05-2025 02:20:01]    \-- apugli 1.9.3+1.19-fabric [13-05-2025 02:20:01] - icarus 1.14.1 [13-05-2025 02:20:01] - identity 2.6.1-1.19.1 [13-05-2025 02:20:01]    \-- omega-config 1.2.3-1.18.1 [13-05-2025 02:20:01] - impaled 1.1.4 [13-05-2025 02:20:01] - itemfig 1.19.2-0.2.7-fabric [13-05-2025 02:20:01] - java 17 [13-05-2025 02:20:01] - journeymap 5.9.8 [13-05-2025 02:20:01]    \-- journeymap-api-fabric 1.19.1-1.9-fabric-SNAPSHOT [13-05-2025 02:20:01] - landchidori 1.0.3 [13-05-2025 02:20:01] - latoorigins 1.19.2-1.1.0 [13-05-2025 02:20:01] - lithium 0.11.1 [13-05-2025 02:20:01] - magic_origins v0.3.5 [13-05-2025 02:20:01] - medievalorigins 5.1.9.2+1.19.2 [13-05-2025 02:20:01]    |-- additionalentityattributes 1.4.0+1.19.2 [13-05-2025 02:20:01]    |-- common-protection-api 1.0.0 [13-05-2025 02:20:01]    \-- reach-entity-attributes 2.3.0 [13-05-2025 02:20:01] - midnightlib 1.0.0 [13-05-2025 02:20:01] - minecraft 1.19.2 [13-05-2025 02:20:01] - moborigins 1.10.0 [13-05-2025 02:20:01] - mrplaguewarper 1.0.8 [13-05-2025 02:20:01] - mythic 1.0.2 [13-05-2025 02:20:01] - mythorigins 1.19-0.2.0 [13-05-2025 02:20:01] - omnitrix_origins 1.0.0 [13-05-2025 02:20:01] - oneporigins 1.0 [13-05-2025 02:20:01] - origins 1.7.1 [13-05-2025 02:20:01]    |-- apoli 2.6.1 [13-05-2025 02:20:01]    |    |-- calio 1.7.0 [13-05-2025 02:20:01]    |    |-- cardinal-components-base 5.0.1 [13-05-2025 02:20:01]    |    |-- cardinal-components-entity 5.0.1 [13-05-2025 02:20:01]    |    |-- cloth-config 8.0.75 [13-05-2025 02:20:01]    |    |    \-- cloth-basic-math 0.6.1 [13-05-2025 02:20:01]    |    \-- playerabilitylib 1.6.0 [13-05-2025 02:20:01]    \-- reach-entity-attributes 2.3.0 [13-05-2025 02:20:01] - origins-plus-plus 2.3.1 [13-05-2025 02:20:01] - origins_4d_being 1.0.0 [13-05-2025 02:20:01] - origins_vampire_mr 1-v2.1.0 [13-05-2025 02:20:01] - originsumbrellas 1.5.4 [13-05-2025 02:20:01] - pehkui 3.8.3+1.14.4-1.21 [13-05-2025 02:20:01]    \-- kanos_config 0.4.1+1.14.4-1.19.4 [13-05-2025 02:20:01] - promans_origins 1.0.0 [13-05-2025 02:20:01] - rpg_origins 1.4.3 [13-05-2025 02:20:01] - sculkling 1.0.0 [13-05-2025 02:20:01] - seleni 0.2.5+1.19.2 [13-05-2025 02:20:01] - slimeorigin 2.0.2-1.19.2 [13-05-2025 02:20:01] - spilaioorigins 1.19-0.3.0 [13-05-2025 02:20:01] - thiccpackets 1.17-1.19+ [13-05-2025 02:20:01] - thorigins 4.2.0 [13-05-2025 02:20:01] - trinkets 3.4.2 [13-05-2025 02:20:01] - voidwalker 1.0.0 [13-05-2025 02:20:01] - yee 3.0.3 [13-05-2025 02:20:01] Found 1 non-fabric mod: [13-05-2025 02:20:01] - better_weapons-1.jar [13-05-2025 02:20:01] SpongePowered MIXIN Subsystem Version=0.8.7 Source=file:/home/smpicnic/server/data/libraries/net/fabricmc/sponge-mixin/0.15.5+mixin.0.8.7/sponge-mixin-0.15.5+mixin.0.8.7.jar Service=Knot/Fabric Env=SERVER [13-05-2025 02:20:01] Compatibility level set to JAVA_17 [13-05-2025 02:20:02] Loaded configuration file for Lithium: 114 options available, 0 override(s) found [13-05-2025 02:20:02] Error loading class: net/minecraft/class_998 (java.lang.ClassNotFoundException: net/minecraft/class_998) [13-05-2025 02:20:02] @Mixin target net.minecraft.class_998 was not found impaled.mixins.json:TridentRiptideFeatureRendererMixin from mod impaled [13-05-2025 02:20:02] Initializing MixinExtras via com.llamalad7.mixinextras.service.MixinExtrasServiceImpl(version=0.4.1). [13-05-2025 02:20:03] Method overwrite conflict for revertScale in slimeorigin.mixins.json:MixinLivingEntity from mod slimeorigin, previously written by latokike.mythorigins.mixin.LivingEntityMixin. Skipping method. [13-05-2025 02:20:03] Added Config bclib.generator to auto sync (file hash) [13-05-2025 02:20:03] Added Config bclib.main to auto sync (content diff) [13-05-2025 02:20:03] Added Config bclib.recipes to auto sync (file hash) [13-05-2025 02:20:03] Added Config bclib.biomes to auto sync (file hash) [13-05-2025 02:20:04] Method overwrite conflict for damage in spilaioorigins.mixins.json:ItemStackMixin from mod spilaioorigins, previously written by latokike.latoorigins.mixin.ItemStackMixin. Skipping method. [13-05-2025 02:20:05] Building unoptimized datafixer [13-05-2025 02:20:05] Method overwrite conflict for method_6091 in moborigins.mixins.json:RavagerEntityMixin from mod moborigins, previously written by draylar.identity.mixin.RavagerEntityMixin. Skipping method. [13-05-2025 02:20:05] Minecraft has crashed! [13-05-2025 02:20:05] net.fabricmc.loader.impl.FormattedException: java.lang.NoSuchFieldError: ATTACK_DAMAGE_MODIFIER [13-05-2025 02:20:05] at net.fabricmc.loader.impl.FormattedException.ofLocalized(FormattedException.java:63) ~[fabric-loader-0.16.14.jar:?] [13-05-2025 02:20:05] at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:482) ~[fabric-loader-0.16.14.jar:?] [13-05-2025 02:20:05] at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) [fabric-loader-0.16.14.jar:?] [13-05-2025 02:20:05] at net.fabricmc.loader.impl.launch.knot.KnotServer.main(KnotServer.java:23) [fabric-loader-0.16.14.jar:?] [13-05-2025 02:20:05] at net.fabricmc.loader.impl.launch.server.FabricServerLauncher.main(FabricServerLauncher.java:69) [fabric-loader-0.16.14.jar:?] [13-05-2025 02:20:05] Caused by: java.lang.NoSuchFieldError: ATTACK_DAMAGE_MODIFIER [13-05-2025 02:20:05] at net.minecraft.class_1799.<clinit>(class_1799.java:126) ~[server-intermediary.jar:?] [13-05-2025 02:20:05] at net.minecraft.class_1761.<init>(class_1761.java:114) ~[server-intermediary.jar:?] [13-05-2025 02:20:05] at net.minecraft.class_1761$1.<init>(class_1761.java:15) ~[server-intermediary.jar:?] [13-05-2025 02:20:05] at net.minecraft.class_1761.<clinit>(class_1761.java:15) ~[server-intermediary.jar:?] [13-05-2025 02:20:05] at net.minecraft.class_1802.<clinit>(class_1802.java:22) ~[server-intermediary.jar:?] [13-05-2025 02:20:05] at net.minecraft.class_1308$Anonymous$dedb2ce0fc304852b6ae6ea54fec0e73.<init>(DropSkullsMixins.java:23) ~[?:?] [13-05-2025 02:20:05] at net.minecraft.class_1308.<clinit>(class_1308.java:87) ~[server-intermediary.jar:?] [13-05-2025 02:20:05] at net.minecraft.class_1299.<clinit>(class_1299.java:260) ~[server-intermediary.jar:?] [13-05-2025 02:20:05] at net.minecraft.class_3103.<clinit>(class_3103.java:28) ~[server-intermediary.jar:?] [13-05-2025 02:20:05] at net.minecraft.class_3031.<clinit>(class_3031.java:84) ~[server-intermediary.jar:?] [13-05-2025 02:20:05] at net.minecraft.class_6800.<clinit>(class_6800.java:20) ~[server-intermediary.jar:?] [13-05-2025 02:20:05] at net.minecraft.class_6803.method_39702(class_6803.java:24) ~[server-intermediary.jar:?] [13-05-2025 02:20:05] at net.minecraft.class_5458.method_44104(class_5458.java:98) ~[server-intermediary.jar:?] [13-05-2025 02:20:05] at net.minecraft.class_5458.method_30566(class_5458.java:105) ~[server-intermediary.jar:?] [13-05-2025 02:20:05] at java.util.LinkedHashMap.forEach(LinkedHashMap.java:721) ~[?:?] [13-05-2025 02:20:05] at net.minecraft.class_5458.<clinit>(class_5458.java:104) ~[server-intermediary.jar:?] [13-05-2025 02:20:05] at net.minecraft.class_2378.<clinit>(class_2378.java:326) ~[server-intermediary.jar:?] [13-05-2025 02:20:05] at net.minecraft.class_2966.method_12851(class_2966.java:50) ~[server-intermediary.jar:?] [13-05-2025 02:20:05] at net.minecraft.server.Main.main(Main.java:98) ~[server-intermediary.jar:?] [13-05-2025 02:20:05] at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:480) ~[fabric-loader-0.16.14.jar:?] [13-05-2025 02:20:05] ... 3 more
    • Every time I try to run a modpack I am using, I get a crash error saying that it was caused by an invalid Java Runtime configuration. I have tried everything I can think of to try and debug it but nothing has worked. https://pastebin.com/ddxQTLh4
  • Topics

×
×
  • Create New...

Important Information

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