package init;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.IChatComponent;
import net.minecraft.world.World;
public class Des extends Item
{
public static ItemStack itemdes;
public ItemStack useItemRightClick(World world, EntityPlayer player)
{
IChatComponent jet = new ChatComponentText("/dndroll 2d6");
player.addChatComponentMessage(jet);
return player;
}
}
Des = Dice in french
itemdes = new Des().setUnlocalizedName("des").setCreativeTab(Heimnor.HeimnorCreativeTabs).setTextureName(Heimnor.MODID + ":des");
Actually i did this. Please tell me if i did something wrong, i have no error but when i do a right click with my item it did nothing.
Hi,
I started to code one week ago, so I'm a beginner and i want to create an item Dice for my server. We have a plugin wich can make dice rolls, so i want to link my item to a command (/dndroll 2d6)... I tried to use the "onItemRightClick" in my ItemDice class but I'm a bit lost when i have to create the line to send the command into the chat of Minecraft.
I hope someone can help me, thanks.
2 replies
Important Information
By using this site, you agree to our Terms of Use.