Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (โ‹ฎ) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Luckydel

Members
  • Joined

  • Last visited

Everything posted by Luckydel

  1. 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
  2. I understood what the problem was, the central point of the model was not in the center of the projectile. Thanks anyway
  3. 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
  4. 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);
  5. Part two I don't understand Where should I insert this vector?
  6. 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; } }
  7. 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 )
  8. 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
  9. 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
  10. It seems I needed runtimeOnly -> compileOnly or do I need to use the API ChampionAsh5357, thx
  11. 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") }
  12. 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
  13. 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.
  14. ChampionAsh5357, thx ๐Ÿงก I thought there was a problem with the textures
  15. Item.Properties().fireResistant() Example:
  16. 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?
  17. sciwhiz12, thx ๐Ÿงก
  18. I have code for 1.18.2: Looks like 1.19 doesn't have IItemRenderProperties. Does anyone have an example or advice?
  19. perromercenary00, thx ๐Ÿ˜ƒ
  20. 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
  21. 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.
  22. 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
  23. 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.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions โ†’ Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.