-
Posts
17 -
Joined
-
Last visited
Everything posted by madmagic
-
@Override public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) { Minecraft.getMinecraft().player.inventory.setInventorySlotContents(103, new ItemStack(ModItems.HEADSET)); return super.onItemRightClick(worldIn, playerIn, handIn); } this is what i tried, i got it to be wearable by using isValidArmor but i also have some other rightclickevents set such as playSound but by using the isValidArmor you cant rightclick the item to equip it
-
because i have a 3D model of a headset that fits just perfecly around the players head when the item is put there using that command and i want to be able to equip it by right clicking wich then exdcutes that command, i tried by doing Minecraft.getMinecraft().player.inventory.setInventorySlotContents(103, new ItemStack(ModItems.HEADSET)) but that wouldnt work, if i changed 103 to 1 then it would work.
-
i added lore to my item using addInformation, i made it gold and light blue using §6 and §b as shown in the 1st image, when i play the game via eclipse it work fine, it looks like the 2nd image shown, but when i build my mod and i use the jar in normal minecraft its messed up like in the 3rd image. why is this and is there a fix?
-
[1.12.2] sound plays multiple times when right click is held down
madmagic replied to madmagic's topic in Modder Support
i have tried using onPlayerStoppedUsing before but for some reason i cant get that to work, do i need to have something that requires a use of the item first in order for it to work? -
i have an item and when i right click it plays a gun shot sound, but if the right click button is held down the sound plays multiple times untill i let go of my mouse button but i want it to play only once, how can i do this? code used for playing the sound: @Override public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) { playerIn.playSound(Sounds.gun_shot, 1.0F, 1.0F); return super.onItemRightClick(worldIn, playerIn, handIn); }
-
i already have my multi tool made, but i made it so its actually a pickaxe but i set effective on to a whole bunch of blocks, but theni have tu manually add all the wood types of stairs, doors fences etc. is there a way around this to make it just work as a pickaxe, axe and shovel?
-
1.12.2 how to add multiple recipes for 1 item?
madmagic replied to madmagic's topic in Modder Support
ah i see i'm dumb, thanks -
1.12.2 how to add multiple recipes for 1 item?
madmagic replied to madmagic's topic in Modder Support
but you cant have duplicate files, how would i do that then? -
so i have a block and i made a shapeless recipe for it by combing a gold block with a nether star: { "type": "minecraft:crafting_shapeless", "ingredients": [ { "item": "minecraft:gold_block" }, { "item": "minecraft:nether_star" } ], "result": { "item": "output", "count": 1 } } } but i want to make it so that the the block can be made by puting 9 of the ingots the block is made of in a crafting table. after some searching around i found this code: "type": "minecraft:crafting_shapeless", "ingredients": [ { [ "item": "minecraft:somewhat0", "data": 0 ], [ "item": "minecraft:somewhat1", "data": 0 ] }, { [ "item": "minecraft:somewhat2", "data": 0 ], [ "item": "minecraft:somewhat3", "data": 0 ] } but this doesnt work for me, it says a few times it got ] but expected something else. so what is the correct way of adding multiple recipes for one item?
-
how to play a sound when right clicking in 1.12
madmagic replied to madmagic's topic in Modder Support
i tried around a bit and i got it to work myself, all is fine now -
how to play a sound when right clicking in 1.12
madmagic replied to madmagic's topic in Modder Support
i want the sound to be played at the player, how would i do so? all examples i found online with Word.playsound(), need some pos in it, but it always says pos cannot be defined to a variable -
i have a sound called sound.ogg, i set everything up and the sound can be played ingame with /playsound. but i want to make it so when i rightclick annywhere with the item in my hand, it will play the sound, currently in the itemSoundPLayer class i have: public ItemSoundPlayer(String name) { super(name); } @Override public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) { ItemStack item = playerIn.getHeldItem(handIn); playsound("sound", 1.0f, 1.0f); return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, item); } but i get the error: The method playsound(String, float, float) is undefined for the type ItemSoundPlayer. i tried 1.0 and 1 instead of 1.0F but i still get an error, on https://mcforge.readthedocs.io/en/latest/effects/sounds/ itsaid to use what i used but it doesnt work, i probably have misundersstood it. as for the rightclick, i cant rightclick the item ingame, i even tried replacing the playsound with a code that makes the player say a message in chat, but that doesnt work
-
1st of all, i dont know annything about java because i will only ever use it for this one mods that im making, i've just been following tutorials online, mainly loremasters tutorial. so far all i have is 1 item called comrade , and the item has a class that extends the itembase: this is what i got so far because of what tutorials told me to do, but now i want to add a lore to the item, i seached alot but i cant find anny tutorial that tells how to do so, some other forums here said to use: public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { par3List.add("lore"); } but i get alot of errors: Multiple markers at this line - EntityPlayer cannot be resolved to a type - Syntax error on token ",", ; expected - Syntax error on token "(", ; expected - void is an invalid type for the variable addInformation - Syntax error on token ",", ; expected - Syntax error on token ")", ; expected - Syntax error on token ",", ; expected i have no idea what they mean but i assume this is an outdated way because it was from a post in 2013. so if annyone can tell me how to do it, or provide me with a screenshot/tutorial. thanks