Jump to content
  • Home
  • Files
  • Docs
  • Merch
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.14.4] Changing / Removing Vanilla Content
1.13 Update Notes for Mod Creators
Sign in to follow this  
Followers 1
MineModder2000

[1.14.4] Changing / Removing Vanilla Content

By MineModder2000, August 10 in Modder Support

  • Reply to this topic
  • Start new topic
  • Prev
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • Next
  • Page 1 of 6  

Recommended Posts

MineModder2000    3

MineModder2000

MineModder2000    3

  • Creeper Killer
  • MineModder2000
  • Members
  • 3
  • 248 posts
Posted August 10 (edited)

Instead of adding in things, I want to know how to remove them.

 

Examples : default mobs and the ability to punch blocks to acquire them.

Edited September 28 by MineModder2000
  • Quote

Share this post


Link to post
Share on other sites

diesieben07    6687

diesieben07

diesieben07    6687

  • Reality Controller
  • diesieben07
  • Forum Team
  • 6687
  • 45709 posts
Posted August 10

This depends on what you want to do.

 

10 minutes ago, MineModder2000 said:

default mobs

You can cancel EntityJoinWorldEvent.

 

11 minutes ago, MineModder2000 said:

the ability to punch blocks to acquire them

You mean you want to disable block drops? Please elaborate.

  • Thanks 1
  • Quote

Share this post


Link to post
Share on other sites

MineModder2000    3

MineModder2000

MineModder2000    3

  • Creeper Killer
  • MineModder2000
  • Members
  • 3
  • 248 posts
Posted August 10
3 minutes ago, diesieben07 said:

This depends on what you want to do.

 

You can cancel EntityJoinWorldEvent.

 

You mean you want to disable block drops? Please elaborate.

Okay thanks I will try that. I mean the punch shouldn't even break blocks. 

  • Quote

Share this post


Link to post
Share on other sites

Animefan8888    677

Animefan8888

Animefan8888    677

  • Reality Controller
  • Animefan8888
  • Forge Modder
  • 677
  • 5746 posts
Posted August 11
1 hour ago, MineModder2000 said:

Okay thanks I will try that. I mean the punch shouldn't even break blocks. 

Use the PlayerEvent.BreakSpeed event and if the player isn't holding an item set the break speed to 0.

  • Thanks 1
  • Quote

Share this post


Link to post
Share on other sites

MineModder2000    3

MineModder2000

MineModder2000    3

  • Creeper Killer
  • MineModder2000
  • Members
  • 3
  • 248 posts
Posted August 11 (edited)
43 minutes ago, Animefan8888 said:

Use the PlayerEvent.BreakSpeed event and if the player isn't holding an item set the break speed to 0.

BreakSpeed isn't a method...

Edited August 11 by MineModder2000
  • Quote

Share this post


Link to post
Share on other sites

Animefan8888    677

Animefan8888

Animefan8888    677

  • Reality Controller
  • Animefan8888
  • Forge Modder
  • 677
  • 5746 posts
Posted August 11
18 minutes ago, MineModder2000 said:

BreakSpeed isn't a method...

It's an event read about them here.

  • Thanks 1
  • Quote

Share this post


Link to post
Share on other sites

MineModder2000    3

MineModder2000

MineModder2000    3

  • Creeper Killer
  • MineModder2000
  • Members
  • 3
  • 248 posts
Posted August 11
1 minute ago, Animefan8888 said:

It's an event read about them here.

I was just reading that before you posted. Thanks, I'll study it and then post any more questions here. 

  • Quote

Share this post


Link to post
Share on other sites

MineModder2000    3

MineModder2000

MineModder2000    3

  • Creeper Killer
  • MineModder2000
  • Members
  • 3
  • 248 posts
Posted August 16 (edited)
On 8/10/2019 at 5:16 PM, Animefan8888 said:

Use the PlayerEvent.BreakSpeed event and if the player isn't holding an item set the break speed to 0.

I figured out events and what not, but I am having trouble doing an if statement check for whether the player is holding an item, 

 

   @SubscribeEvent
    public void breakSpeed(BreakSpeed event) {
        
        event.setNewSpeed(0);
    }

 

I don't how to check for that exactly. 

Edited August 17 by MineModder2000
  • Quote

Share this post


Link to post
Share on other sites

Animefan8888    677

Animefan8888

Animefan8888    677

  • Reality Controller
  • Animefan8888
  • Forge Modder
  • 677
  • 5746 posts
Posted August 17
3 hours ago, MineModder2000 said:

I don't how to check for that exactly. 

event.getEntityPlayer().getHeldItem(Hand.MAIN_HAND).getItem() == SOME_ITEM_FIELD

  • Thanks 1
  • Quote

Share this post


Link to post
Share on other sites

MineModder2000    3

MineModder2000

MineModder2000    3

  • Creeper Killer
  • MineModder2000
  • Members
  • 3
  • 248 posts
Posted August 17
40 minutes ago, Animefan8888 said:

event.getEntityPlayer().getHeldItem(Hand.MAIN_HAND).getItem() == SOME_ITEM_FIELD

 

It warns me :

 

Quote

 The method getEntityPlayer() from the type PlayerEvent is deprecated

 

  • Quote

Share this post


Link to post
Share on other sites

Animefan8888    677

Animefan8888

Animefan8888    677

  • Reality Controller
  • Animefan8888
  • Forge Modder
  • 677
  • 5746 posts
Posted August 17
1 minute ago, MineModder2000 said:

It warns me :

It should still work what version are you modding for?

  • Thanks 1
  • Quote

Share this post


Link to post
Share on other sites

MineModder2000    3

MineModder2000

MineModder2000    3

  • Creeper Killer
  • MineModder2000
  • Members
  • 3
  • 248 posts
Posted August 17 (edited)
7 minutes ago, Animefan8888 said:

It should still work what version are you modding for?

 

1.14.4. Also getItem() method looks like this :

 

return this.isEmpty || this.delegate == null ? Items.AIR : this.delegate.get();

 

isEmpty would be useful of course, but's its a private boolean variable....

Edited August 17 by MineModder2000
  • Quote

Share this post


Link to post
Share on other sites

Animefan8888    677

Animefan8888

Animefan8888    677

  • Reality Controller
  • Animefan8888
  • Forge Modder
  • 677
  • 5746 posts
Posted August 17
Just now, MineModder2000 said:

isEmpty would be useful of course, but's its a private boolean variable....

Instead use ItemStack.isEmpty(event.getEntityPlayer.getHeldItem(Hand.MAIN_HAND))

  • Quote

Share this post


Link to post
Share on other sites

MineModder2000    3

MineModder2000

MineModder2000    3

  • Creeper Killer
  • MineModder2000
  • Members
  • 3
  • 248 posts
Posted August 17 (edited)
7 minutes ago, Animefan8888 said:

Instead use ItemStack.isEmpty(event.getEntityPlayer.getHeldItem(Hand.MAIN_HAND))

Quote

The method isEmpty() in the type ItemStack is not applicable for the arguments (ItemStack)

 

That method is empty and doesn't accept parameters. Also it says not to make a reference to it since its not static....

Edited August 17 by MineModder2000
  • Quote

Share this post


Link to post
Share on other sites

Animefan8888    677

Animefan8888

Animefan8888    677

  • Reality Controller
  • Animefan8888
  • Forge Modder
  • 677
  • 5746 posts
Posted August 17
2 minutes ago, MineModder2000 said:

That method is empty and doesn't accept parameters. 

Oops my bad. Use ItemStack#isEmpty so

event.getEntityPlayer().getHeldItem(Hand.MAIN_HAND).isEmpty()

  • Thanks 2
  • Quote

Share this post


Link to post
Share on other sites

MineModder2000    3

MineModder2000

MineModder2000    3

  • Creeper Killer
  • MineModder2000
  • Members
  • 3
  • 248 posts
Posted August 17
5 minutes ago, Animefan8888 said:

Oops my bad. Use ItemStack#isEmpty so

event.getEntityPlayer().getHeldItem(Hand.MAIN_HAND).isEmpty()

Works like a charm. But with this I can still break blocks if I have a flower or anything else in the player's hand. What I intend is to only be able to break blocks with the correct tool (shovel for dirt, axe for wood, etc.)

  • Quote

Share this post


Link to post
Share on other sites

Animefan8888    677

Animefan8888

Animefan8888    677

  • Reality Controller
  • Animefan8888
  • Forge Modder
  • 677
  • 5746 posts
Posted August 17
1 minute ago, MineModder2000 said:

But with this I can still break blocks if I have a flower or anything else in the player's hand. What I intend is to only be able to break blocks with the correct tool (shovel for dirt, axe for wood, etc.)

Then you'll want to check if they have a tool that can break the block.

  • Thanks 1
  • Quote

Share this post


Link to post
Share on other sites

DaemonUmbra    358

DaemonUmbra

DaemonUmbra    358

  • Reality Controller
  • DaemonUmbra
  • Forum Team
  • 358
  • 6426 posts
Posted August 17

Exactly how are you supposed to get tools if you can't punch trees? Please explain.

  • Haha 1
  • Quote

Share this post


Link to post
Share on other sites

Animefan8888    677

Animefan8888

Animefan8888    677

  • Reality Controller
  • Animefan8888
  • Forge Modder
  • 677
  • 5746 posts
Posted August 17
1 minute ago, DaemonUmbra said:

Exactly how are you supposed to get tools if you can't punch trees? Please explain.

Does it really matter? Why would they make a mod where you can't progress?

  • Quote

Share this post


Link to post
Share on other sites

MineModder2000    3

MineModder2000

MineModder2000    3

  • Creeper Killer
  • MineModder2000
  • Members
  • 3
  • 248 posts
Posted August 17
1 minute ago, Animefan8888 said:

Does it really matter? Why would they make a mod where you can't progress?

 

4 minutes ago, DaemonUmbra said:

Exactly how are you supposed to get tools if you can't punch trees? Please explain.

 

Haha, I have ideas. Such as gather-able sticks and stone generating through the world that will make your first set of tools. 

  • Quote

Share this post


Link to post
Share on other sites

MineModder2000    3

MineModder2000

MineModder2000    3

  • Creeper Killer
  • MineModder2000
  • Members
  • 3
  • 248 posts
Posted August 17
11 minutes ago, Animefan8888 said:

Then you'll want to check if they have a tool that can break the block.

Of course, but I'm not sure how to do that. 

  • Quote

Share this post


Link to post
Share on other sites

Animefan8888    677

Animefan8888

Animefan8888    677

  • Reality Controller
  • Animefan8888
  • Forge Modder
  • 677
  • 5746 posts
Posted August 17
1 minute ago, MineModder2000 said:

Of course, but I'm not sure how to do that. 

Well you know how to get the Item and the ItemStack the player is holding. You can check. Look at the tool Items in Items.class. They have methods you might be able to use. Or you can use instanceof checks.

  • Thanks 1
  • Quote

Share this post


Link to post
Share on other sites

MineModder2000    3

MineModder2000

MineModder2000    3

  • Creeper Killer
  • MineModder2000
  • Members
  • 3
  • 248 posts
Posted August 17
5 minutes ago, Animefan8888 said:

Well you know how to get the Item and the ItemStack the player is holding. You can check. Look at the tool Items in Items.class. They have methods you might be able to use. Or you can use instanceof checks.

Right but how about checking against the block that is aimed at? 

  • Quote

Share this post


Link to post
Share on other sites

Animefan8888    677

Animefan8888

Animefan8888    677

  • Reality Controller
  • Animefan8888
  • Forge Modder
  • 677
  • 5746 posts
Posted August 17
Just now, MineModder2000 said:

Right but how about checking against the block that is aimed at? 

event.getState() will give you the BlockState

  • Thanks 1
  • Quote

Share this post


Link to post
Share on other sites

MineModder2000    3

MineModder2000

MineModder2000    3

  • Creeper Killer
  • MineModder2000
  • Members
  • 3
  • 248 posts
Posted August 17
32 minutes ago, Animefan8888 said:

event.getState() will give you the BlockState

Thanks making some progress. I'll see how far I can get, I should be able to figure this out. 

  • Quote

Share this post


Link to post
Share on other sites
  • Prev
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • Next
  • Page 1 of 6  

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • DaemonUmbra
      pointing to MCP folder instead of MDK ???

      By DaemonUmbra · Posted 6 minutes ago

      Learn Java before you attempt modding. Oh, I missed the sarcasm part. However you do seem to be struggling with a few things that I would consider basic.
    • DaemonUmbra
      cant use mods in survival 1.12.2

      By DaemonUmbra · Posted 7 minutes ago

      So what is the problem now? Will the server not start or can you not connect?
    • JMAS
      pointing to MCP folder instead of MDK ???

      By JMAS · Posted 12 minutes ago

      I apologize in an advance if this is a noob level question:  In the class file I'm creating I'm trying to import net.minecraft.nbt.NBTTagCompound which apparently is no longer in the 1.14.4 MDK but instead is at the MCP folder at  \mcp940\bin\minecraft\net\minecraft\nbt I have the MCP folder listed in the libraries under project structure (using IntelliJ 2019.3), but in the individual class file I can't get it to make that connection for importing. How do I do this?   (P.S. I've been learning to code Java for an  hour and 13 minutes now (sarcasm), so thanks for helping me with my learning curve.)
    • Draco18s
      Distinguish singleplayer vs. multiplayer

      By Draco18s · Posted 12 minutes ago

      This will always be true on the client
    • DragonITA
      [1.14.4] How to get Minecraft Horse model/texture to make a custom unicorn?

      By DragonITA · Posted 12 minutes ago

      Ok sorry, tomorrow can i show you the code, good night. 
  • Topics

    • JMAS
      1
      pointing to MCP folder instead of MDK ???

      By JMAS
      Started 11 minutes ago

    • Barca
      5
      cant use mods in survival 1.12.2

      By Barca
      Started 2 hours ago

    • solitone
      19
      Distinguish singleplayer vs. multiplayer

      By solitone
      Started December 5

    • DragonITA
      35
      [1.14.4] How to get Minecraft Horse model/texture to make a custom unicorn?

      By DragonITA
      Started Monday at 10:06 AM

    • Jaffaaaaa
      1
      ScreenGui does nothing

      By Jaffaaaaa
      Started Yesterday at 07:03 PM

  • Who's Online (See full list)

    • DaemonUmbra
    • Draco18s
    • Powerxd
    • JMAS
    • access_denied
    • Sivonja
    • Barca
    • DragonITA
    • Jaffaaaaa
    • dylandmrl
    • deerangle
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.14.4] Changing / Removing Vanilla Content
  • Theme
  • Contact Us
  • Discord

Copyright © 2019 ForgeDevelopment LLC · Ads by Curse Powered by Invision Community