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.

Featured Replies

Posted

Sorry for my bad English, I`m from Poland.

 

Code:

package rpgcraft;
import java.awt.Event;
import java.util.ArrayList;
import java.util.Random;

import rpgcraft.blocks.Blockdarksapling;
import rpgcraft.blocks.blocks;
import net.minecraft.block.Block;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.event.Event.Result;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.player.BonemealEvent;

public class EventClass
{


@ForgeSubscribe
public void usedBonemeal(BonemealEvent event)
{
 int i = 0;
 int j =  (new Random()).nextInt(5);


 if (event.ID == blocks.darksapling.blockID)
 {
 if (i != j)
 i += i;
 else if (i == j)
 {
 if (!event.world.isRemote)
 {
	 ((Blockdarksapling)blocks.darksapling).growTree(event.world, event.X, event.Y, event.Z, event.world.rand);
	 event.setResult(Result.ALLOW);
 }
 }
 }
}
}

 

It work, tree is generating, but it don`t showing particles. Why? And how to fix it?

Sorry for my bad English, I`m from Poland.

 

Code:

package rpgcraft;
import java.awt.Event;
import java.util.ArrayList;
import java.util.Random;

import rpgcraft.blocks.Blockdarksapling;
import rpgcraft.blocks.blocks;
import net.minecraft.block.Block;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.event.Event.Result;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.player.BonemealEvent;

public class EventClass
{


@ForgeSubscribe
public void usedBonemeal(BonemealEvent event)
{
 int i = 0;
 int j =  (new Random()).nextInt(5);


 if (event.ID == blocks.darksapling.blockID)
 {
 if (i != j)
 i += i;
 else if (i == j)
 {
 if (!event.world.isRemote)
 {
	 ((Blockdarksapling)blocks.darksapling).growTree(event.world, event.X, event.Y, event.Z, event.world.rand);
	 event.setResult(Result.ALLOW);
 }
 }
 }
}
}

 

It work, tree is generating, but it don`t showing particles. Why? And how to fix it?

 

put this in the usedBonemeal event

par3World.spawnParticle("villagerHappy", par4, par5, par6, 0.0D, 0.5D, 0.0D);

  • Author

When I`m add this, I have only errors and crash :(

 

PS:

World.spawnParticle("villagerHappy", par4, par5, par6, 0.0D, 0.5D, 0.0D);

give crash too.

When I`m add this, I have only errors and crash :(

 

PS:

World.spawnParticle("villagerHappy", par4, par5, par6, 0.0D, 0.5D, 0.0D);

give crash too.

ah... i didn't see that there was no World parameter try adding one like "World par3World"

  • Author

Still crashing. Eclipse asking about par4, par5, par6.

  • Author

Now, when I use:

public void usedBonemeal(World par3World, BonemealEvent event)

eclipse don`t show any errors, but minecraft has crashing.

 

When I use:

public void usedBonemeal(BonemealEvent event)

eclipse asking about change

public void spawnParticle(String par1Str, double par2, double par4, double par6, double par8, double par10, double par12)
    {
...
    }

to static. I can`t do it, becouse that make a lot of errors in other files (and i don`t edit vanilla code :P)

event.setResult(Result.ALLOW);

You need to do that on client side too.

Particles should already be done by the bonemeal itself.

Guest
This topic is now closed to further replies.

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.