how do you make a disk

Started by V8gaming on Fri, 10/28/2016 - 21:22

Topic category: Help with MCreator's application

Last seen on 22:39, 20. May 2017
Joined Oct 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
how do you make a disk
Fri, 10/28/2016 - 21:22

please help me im new and i want to make a mo'music mod

 

Last seen on 23:58, 10. Nov 2018
Joined Aug 2013
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • wiki contributor
  • moderator
Your Item needs extend
Fri, 10/28/2016 - 21:54

Your Item needs extend ItemRecord. It will want a string argument in a constructor. That's the record name. Also you will need variable of type Map , and override some methods:

 

[spoiler]

 @Override
public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ)
    {
        IBlockState iblockstate = worldIn.getBlockState(pos);

        if (iblockstate.getBlock() == Blocks.jukebox && !((Boolean)iblockstate.getValue(BlockJukebox.HAS_RECORD)).booleanValue())
        {
            if (worldIn.isRemote)
            {
                return true;
            }
            else
            {
                ((BlockJukebox)Blocks.jukebox).insertRecord(worldIn, pos, iblockstate, stack);
                worldIn.playAuxSFXAtEntity((EntityPlayer)null, 1005, pos, Item.getIdFromItem(this));
                --stack.stackSize;
                return true;
            }
        }
        else
        {
            return false;
        }
    }

 @Override
 public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
 {
 par3List.add(this.getRecordNameLocal());
 }

 @Override
 //TODO: getRecordTitle()
 public String getRecordNameLocal()
 {
 return StatCollector.translateToLocal(this.getUnlocalizedName() + ".desc");
 }

 @Override
 public EnumRarity getRarity(ItemStack itemStack)
 {
 return EnumRarity.RARE;
 }

 public static MusicDisc getRecord(String par0Str)
 {
 return (MusicDisc)records.get(par0Str);
 }

 @Override
 public ResourceLocation getRecordResource(String name)
 {
 return new ResourceLocation("testenvironmentmod:" + name);
 }

[/spoiler]

Last seen on 04:50, 10. Nov 2018
Joined Dec 2013
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
  • wiki contributor
  • moderator
RE:Your Item needs extend
Fri, 10/28/2016 - 23:20

@#1 Hi, Nuparu. Thank yoy for helping users, but can you be more specific with helping. Most users are of the younger generation and understand very little about code. Video specific tutorials are the greatest, but you sound code savy enough to translate and help them more.

Last seen on 15:16, 14. Aug 2018
Joined Aug 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
Nuparu00 I do not understand…
Tue, 08/14/2018 - 15:12

Nuparu00 I do not understand how you do it.

Last seen on 15:16, 1. Nov 2018
Joined Aug 2018
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
I think I remember there…
Sun, 08/19/2018 - 09:32

I think I remember there being a way to doing it without code, but Its not there for me.

Last seen on 10:44, 9. Oct 2018
Joined Jul 2018
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
After some experimenting I…
Mon, 08/20/2018 - 09:44

After some experimenting I think I can answer this for you:

1. Make a new procedure and use the "Play at..." event and select your music disc sound that you should have already uploaded as a .ogg file.

2. Make a new "item" Mod Element, upload your disc texture and do what you need to. When you get to procedure there is a "When right clicked on block and choose the procedure u just made. This will mean that when the disc is right clicked against a block your new music disc sound will be played. I am sorry though, as this will mean the disc can be played clicked on whatever block and not just a Jukebox. If you're still fine with this, then it will work fine for you!

Also, you can try make a procedure that block checks but my MCreator keeps crashing when trying to select a block when making a procedure but you can always try that although i have no idea if it will work! :D 

Last seen on 16:47, 7. Nov 2018
Joined Mar 2017
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
First, although this is the…
Tue, 08/21/2018 - 05:36

First, although this is the best method, it still doesn't act like a vanilla music disc. It doesn't consume the disk when played (this is possible)and it doesn't give it back when the jukebox is right clicked.

Second, For me mcreator works fine with blocks in procedures, so I think you should open a ticket on the tracker for this bug if there isn't one yet. 

Third, Nuparu00 should specify where exactly to insert that code.(the line of code)