Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Suggestions

Suggestions for new Forge hooks, interfaces, etc...


845 topics in this forum

    • 1 reply
    • 2.1k views
    • 0 replies
    • 1.4k views
    • 2 replies
    • 1.5k views
    • 3 replies
    • 1.8k views
    • 0 replies
    • 2k views
    • 3 replies
    • 3k views
    • 2 replies
    • 2.3k views
    • 3 replies
    • 2.8k views
    • 0 replies
    • 2.1k views
    • 0 replies
    • 1.5k views
    • 4 replies
    • 6.8k views
    • 1 reply
    • 2.5k views
    • 3 replies
    • 5.4k views
    • 1 reply
    • 3k views
    • 1 reply
    • 6.8k views
    • 4 replies
    • 2.8k views
    • 0 replies
    • 2.4k views
    • 2 replies
    • 3.3k views
    • 1 reply
    • 1.6k views
    • 2 replies
    • 2.9k views
    • 0 replies
    • 1.9k views
    • 0 replies
    • 4.1k views
    • 2 replies
    • 2.1k views
    • 0 replies
    • 2.2k views
    • 1 reply
    • 2.4k views


  • Posts

    • Looks like minecraft uses Blaze3D for rendering, but I have no idea what to do with these MatrixStacks, RenderTypeBuffers, etc, and I cant find any documentation about it. Vanilla examples are not helpful at all, because all the variables lost their original names and its impossible to understand whats going on. Any suggestions where to start?
    • Hi! I was trying to create a smoke projectile, that when hits the ground spawn some particles for a certain duration. The problem is that, when the entity hits the ground, it don't spawn the particles at all. Here is my projectile: @OnlyIn(value = Dist.CLIENT, _interface = IRendersAsItem.class) public class SmokeBulletEntity extends DamagingProjectileEntity implements IRendersAsItem { private static final ItemStack STACK = new ItemStack(ModItems.BULLET.get()); private boolean activated; private int duration; public SmokeBulletEntity(World world) { super(ModEntities.SMOKE_BULLET.get(), world); this.activated = false; } @Override public ItemStack getItem() { return STACK; } @Override protected void onHitBlock(BlockRayTraceResult rayTraceResult) { if (this.activated) return; if (!this.level.isClientSide) { this.activate(); } super.onHitBlock(rayTraceResult); } @Override protected void onHitEntity(EntityRayTraceResult entityRayTraceResult) { //Must be Empty } private void activate() { this.activated = true; this.duration = 200; this.setDeltaMovement(0, 0, 0); this.xPower = 0; this.yPower = 0; this.zPower = 0; System.out.println("Active Smoke Projectile"); } @Override public void tick() { if (this.activated && !this.level.isClientSide) { //System.out.println(String.format("%f, %f, %f", this.getX(), this.getY(), this.getZ())); for (int i = 0; i < 100; i++) { this.level.addParticle(ParticleTypes.FLAME, this.getX(), this.getY() + i, this.getZ(), 0, 0, 0); } this.duration--; if (this.duration <= 0) { this.remove(); } } else { super.tick(); } } @Override public void addAdditionalSaveData(CompoundNBT nbt) { super.addAdditionalSaveData(nbt); nbt.putBoolean("activated", this.activated); nbt.putInt("duration", this.duration); } @Override public void readAdditionalSaveData(CompoundNBT nbt) { super.readAdditionalSaveData(nbt); if (nbt.contains("activated")) { this.activated = nbt.getBoolean("activated"); } if (nbt.contains("duration")) { this.duration = nbt.getInt("duration"); } } @Override public IPacket<?> getAddEntityPacket() { return NetworkHooks.getEntitySpawningPacket(this); } } Can somebody explain me why? Thanks!
    • Yes, this sounds good. However show your code once you've implemented this. You need an IServerWorld (do an instanceof check).
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.