-
Posts
66 -
Joined
-
Last visited
Everything posted by Luckydel
-
Everything I could find suitable. The following questions arose: 1. Is there an easier way? 2. If not, there are examples that are suitable for 1.19? 3. If not, most of the methods,classes on 1.15 are called differently =( . How to deal with this? edit: Probably it is necessary to clarify that I am also doing a mod for weapons
-
[1.19] Projectile entity spawns with deflection
Luckydel replied to Luckydel's topic in Modder Support
I understood what the problem was, the central point of the model was not in the center of the projectile. Thanks anyway -
[1.19] Projectile entity spawns with deflection
Luckydel replied to Luckydel's topic in Modder Support
I understand getXRot() gives values from -180 to 180 around the player, if i make getXRot()+0.5F it will be a mistake. It seems to me to do if(getXRot()>0) +0.5F and (getXRot()<0) -0.5F not very correct -
[1.19] Projectile entity spawns with deflection
Luckydel replied to Luckydel's topic in Modder Support
I'm sorry, I don't understand how this will help me. I need the projectile to spawn exactly in the center of the intersection. Right now he appears on the side. Am I not getting them here? entitybullet.shootFromRotation(entity, entity.getXRot(), entity.getYRot()+0.4F, 0.0F, power, spreading); -
[1.19] Projectile entity spawns with deflection
Luckydel replied to Luckydel's topic in Modder Support
Part two I don't understand Where should I insert this vector? -
Spawn: https://ibb.co/NKnvqXk How i would like: https://ibb.co/BLYgwW7 public class BulletEntity extends AbstractBullet implements IEntityAdditionalSpawnData { ... public static BulletEntity shoot(Level world, Player entity, float power, double damage, int knockback, RegistryObject<SoundEvent> soundName, float spreading) { BulletEntity entitybullet = new BulletEntity(world,entity); entitybullet.shootFromRotation(entity, entity.getXRot(), entity.getYRot()+0.4F, 0.0F, power, spreading); //entitybullet.shoot(entity.getViewVector(1).x, entity.getViewVector(1).y, entity.getViewVector(1).z, power, spreading); ... I tried changing the arguments shootFromRotation, shoot. By height (y) I succeeded, but x did not. But when you turn the mouse, the coordinates of the entity are distorted Actions in AbstractBullet(Identical to AbstractArrow) did not help public abstract class AbstractBullet extends Projectile { ... protected AbstractBullet(EntityType<? extends AbstractBullet> p_36717_, LivingEntity p_36718_, Level p_36719_) { this(p_36717_, p_36718_.getX()-0.5F, p_36718_.getEyeY()+0.5F, p_36718_.getZ(), p_36719_); this.setOwner(p_36718_); if (p_36718_ instanceof Player) { this.pickup = AbstractBullet.Pickup.ALLOWED; } }
-
I need to make the projectile invisible for a while. Do I have to use MobEffects, or is there a better way? ( I need it just for beauty )
-
[1.19] Projectile rendering incorrectly when given a high velocity
Luckydel replied to Luckydel's topic in Modder Support
I tried this public Packet<?> getAddEntityPacket(){ Entity entity = this.getOwner(); int i = entity == null ? 0 : entity.getId(); double xPower = getDeltaMovement().x; double yPower = getDeltaMovement().y; double zPower = getDeltaMovement().z; return new ClientboundAddEntityPacket(this.getId(), this.getUUID(), this.getX(), this.getY(), this.getZ(), this.getXRot(), this.getYRot(), this.getType(), i, new Vec3(xPower, yPower, zPower), 0.0D); } The entity just hangs in the air and disappears I tried to make my class like ClientboundAddEntityPacket public class sendVecEntity2 implements Packet<ClientGamePacketListener> { private final int id; private final UUID uuid; private final EntityType<?> type; private final double x; private final double y; private final double z; private final int xa; private final int ya; private final int za; private final byte xRot; private final byte yRot; private final byte yHeadRot; private final int data; public sendVecEntity2(int p_237546_, UUID p_237547_, double p_237548_, double p_237549_, double p_237550_, float p_237551_, float p_237552_, EntityType<?> p_237553_, int p_237554_, Vec3 p_237555_, double p_237556_) { this.id = p_237546_; this.uuid = p_237547_; this.x = p_237548_; this.y = p_237549_; this.z = p_237550_; this.xRot = (byte) Mth.floor(p_237551_ * 256.0F / 360.0F); this.yRot = (byte)Mth.floor(p_237552_ * 256.0F / 360.0F); this.yHeadRot = (byte)Mth.floor(p_237556_ * 256.0D / 360.0D); this.type = p_237553_; this.data = p_237554_; this.xa = (int)(Mth.clamp(p_237555_.x, -3.9D, 3.9D) * 8000.0D); this.ya = (int)(Mth.clamp(p_237555_.y, -3.9D, 3.9D) * 8000.0D); this.za = (int)(Mth.clamp(p_237555_.z, -3.9D, 3.9D) * 8000.0D); } public void write(FriendlyByteBuf p_131498_) { p_131498_.writeVarInt(this.id); p_131498_.writeUUID(this.uuid); p_131498_.writeId(Registry.ENTITY_TYPE, this.type); p_131498_.writeDouble(this.x); p_131498_.writeDouble(this.y); p_131498_.writeDouble(this.z); p_131498_.writeByte(this.xRot); p_131498_.writeByte(this.yRot); p_131498_.writeByte(this.yHeadRot); p_131498_.writeVarInt(this.data); p_131498_.writeShort(this.xa); p_131498_.writeShort(this.ya); p_131498_.writeShort(this.za); } //maybe @Override public void handle(ClientGamePacketListener p_131342_) { //p_131495_.handleAddEntity(this); } } But obviously it didn't help. I probably need to register it, but I don't understand how -
I didn't understand some things in this thread Looks like I need this https://ibb.co/3zkRxWf How to use NetworkHooks.getEntitySpawningPacket ? (And do I need to use it?) and Where to send the custom package. From what point in the code will it be correct to send it. How to form correctly. I messed with the package a bit and was able to spawn a cow through the server, but that seems to be all I can :3
-
It seems I needed runtimeOnly -> compileOnly or do I need to use the API ChampionAsh5357, thx
-
I looked at their example https://github.com/TheIllusiveC4/Curios/blob/1.19.x/src/test/java/top/theillusivec4/curiostest/common/item/CrownItem.java There may be a problem in build.gradle build.gradle: repositories { maven { url 'https://maven.theillusivec4.top/' } } dependencies { minecraft 'net.minecraftforge:forge:1.19-41.1.0' runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:1.19.2-5.1.1.0") compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:1.19.2-5.1.1.0:api") }
-
Intellij only sees /api https://ibb.co/r43DkB9 https://ibb.co/B6HN2VC Forgive me if I'm asking this question in the wrong forum, but mb someone came across this
-
I would like to add an extra slot of armor Maybe someone can suggest the classes that I need. And where is it to be initialized. And how to put it all together. I understand that I can be asking a lot, but I would just need a direction where to dig.
-
ChampionAsh5357, thx 🧡 I thought there was a problem with the textures
-
Item.Properties().fireResistant() Example:
-
The continuation I get an exception: Caused by: java.lang.NullPointerException: Cannot invoke "String.indexOf(int)" because "texture" is null Model: Armor item: Registry armor item: Registry model armor: I did not create the rendering, should I do it?
-
sciwhiz12, thx 🧡
-
I have code for 1.18.2: Looks like 1.19 doesn't have IItemRenderProperties. Does anyone have an example or advice?
-
perromercenary00, thx 😃
-
Thanks for the advice, I'll fix the code. I registered the layer and render as you indicated. perromercenary00, thanks, I saw the error, tried to use shootFromRotation, the result is identical =( ChampionAsh5357, I think it looks better here
-
Entity Item class Render Model Well, in the 2nd video, you can see that the slime is dying, but the bullet model is in a completely different place.
-
I use: @OnlyIn(value = Dist.CLIENT, _interface = ItemSupplier.class) public class BulletEntity extends AbstractArrow implements ItemSupplier{ public BulletEntity(EntityType<? extends BulletEntity> type, LivingEntity entity, Level world) { super(type, entity, world); } Bla-bla-bla BulletEntity entitybullet = new BulletEntity(ForgeModEntities.BULLETENTITY.get(), entity, world); entitybullet.shoot(entity.getViewVector(1).x, entity.getViewVector(1).y, entity.getViewVector(1).z, POWER, spreading); //... } Where: POWER = 4f POWER = 5f and >5f I would like to make the projectile with more power and without visual bugs. Perhaps I should somehow manually move the entity through ticks or override shoot() and play around with vectors
-
Oh no, I don't think I explained it correctly, I need to <move up the mouse>, only through the code. Well, you know, like in shooters when the weapon rises when shooting, I apologize for my English.