>.< I know I been quite the bother, and thank you everyone for helping me out. but I got a problem with ItemStacking... first I can't figure out how to make an ItemStack have actual items, such as wooden axe, pickaxe etc. also this line of code seems to be bickering at me, so I couldn't figure it out how to fix it, even with documentation provided. >.< public void onPlayerRespawn(PlayerRespawnEvent event){ Player player = event.getPlayer(); ItemStack wooden = new ItemStack(Block.WOOD,64); Inventory inv = player.getInventory(); inv.addItem(wooden); } [I want to give them wooden items, but since I couldn't figure the ItemStack I tried a simple set of 64 woods...which failed]
@Monckey100 Use Material not Block for making items. As an example, to add a wooden pickaxe to player's inventory: Code: public void onPlayerRespawn( PlayerRespawnEvent event ) { event.getPlayer( ).getInventory( ).addItem( new ItemStack( Material.WOOD_PICKAXE, 1 ) ); }
it says its not applicable for the arguements(Item stack) the constructor material is undefined (material,int) is undefined [that was a direct copy pasta of what you wrote] also would like to note that I did try to use material earlier >.< EDIT by Moderator: merged posts, please use the edit button instead of double posting.
It works fine on my end and I am using the most recent Bukkit build. Are you importing Material? (org.bukkit.Material) edit: Here it is in the JavaDocs: addItem ItemStack
I'm using the most recent bukkit build too, and yes the material is imported. I'm also having a problem working with Entities, I can't seem to get the event.getTarget() to work >.< bukkit just spews errors out EDIT by Moderator: merged posts, please use the edit button instead of double posting.
no no no, that was a seperate question altogether. I was trying to check if a spider is attacking a human or if a human is attacking a cow etc. but my first one still stands which is basically giving a player wooden items when they die anyone X_X >.< its probably my bukkit or some crap, can someone link me to the most RECENT build EDIT by Moderator: merged posts, please use the edit button instead of double posting.
http://ci.bukkit.org/job/dev-Bukkit/lastSuccessfulBuild/ Always lists the most recent. Bukkit: http://ci.bukkit.org/job/dev-Bukkit/lastSuccessfulBuild/artifact/target/bukkit-0.0.1-SNAPSHOT.jar CraftBukkit: http://ci.bukkit.org/job/dev-CraftBukkit/612/artifact/target/craftbukkit-0.0.1-SNAPSHOT.jar