-
Posts
16559 -
Joined
-
Last visited
-
Days Won
156
Everything posted by Draco18s
-
[1.15] How to Grant and Check on Advancements
Draco18s replied to Kristopher_RAS's topic in Modder Support
You can't call that code on the server. You can't access a ClientPlayerEntity on the server (it is a CLIENT only class). -
[SOLVED]-[1.15.2] Break Speed event for vanilla Materials
Draco18s replied to Wintersky20's topic in Modder Support
More specifically, this post: -
fortune and silktouch enchantments when breaking blocks
Draco18s replied to Crare1's topic in Modder Support
Yep, that's the spot. I haven't been in a position to open up my IDE and go poking around, I just knew what to look for. Anyway, sounds like you're on the right track. -
Vanilla already has this item. Its called BlockItem or NamedBlockItem (both have slightly different features).
-
[1.15] How to Grant and Check on Advancements
Draco18s replied to Kristopher_RAS's topic in Modder Support
It was kinda late, I fuckered that up. XD Fixed it. -
[1.15] TileEntity, Container created twice
Draco18s replied to Kristopher_RAS's topic in Modder Support
$10 says that you're seeing one get created on the client thread and one on the server thread. getUpdatePacket, getUpdateTag, and onDataPacket -
[1.15] How to Grant and Check on Advancements
Draco18s replied to Kristopher_RAS's topic in Modder Support
That would be the client side yes. You need to send a packet to the server (all this packet does is say "this button was clicked"!) and the server does the operations neccessary (including checking to make sure that the player is allowed to click the button). Quick "Am I on the Server?" guide: Is it visual? No, you are on the client Is it input related? No, you are on the client Was a world or player object passed to you? Maybe, check world.isRemote (or player.world.isRemote) isRemote returns true? No, you are on the client Did you get your world by calling Minecraft.getInstance()? No, you are on the client. Also don't do this unless you know what you're doing. -
Help with customized spawn for every new world loaded [1.12.2]
Draco18s replied to erendanet's topic in Modder Support
-
fortune and silktouch enchantments when breaking blocks
Draco18s replied to Crare1's topic in Modder Support
Correct. No longer exists. Well, the event exists, but it isn't actually used any more. See this PR. But if you don't want to handle that yourself, find the area of the code where the existing BreakEvent is fired and drops are generated, and see what calls it and call that yourself. -
[1.14.4] CustomContainerItem - Store specific item
Draco18s replied to VenelALEX's topic in Modder Support
You need a custom slot: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/harderores/inventory/SlotDust.java Line 17 is the important one, all you need to do is check for one item. And a sublcass of ItemStackHandler: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/harderores/entity/capability/SiftableItemsHandler.java (You won't need onContentsChanged, that's specific to my block, just edit line 15 to be the same logic as the line 17 of your slot class). -
Overwrite it using a "blank" recipe: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/resources/data/minecraft/recipes/sugar.json
-
[SOLVED]-[1.15.2] Break Speed event for vanilla Materials
Draco18s replied to Wintersky20's topic in Modder Support
This is the wrong bus. -
fortune and silktouch enchantments when breaking blocks
Draco18s replied to Crare1's topic in Modder Support
That's a good start. As long as you insure that the blockPos you're passing there is one of the adjacent blocks you're trying to break. Second, the event has a canceled property. If the event has been canceled when it gets back to you, you need to not break the block. This is typically done by: if(MinecraftForge.EVENT_BUS.post(event)) { //break the block } -
[SOLVED]-[1.15.2] Break Speed event for vanilla Materials
Draco18s replied to Wintersky20's topic in Modder Support
ItemStacks are never null. -
Uh...have you tried fixing that error right there? Also, don't use BlockBase (Code Style #4). You do realize that your item needs to know about your block in order to place it, right?
-
Some data json file somewhere has a problem (could be just about anything in the data folder, one of the files you added, could be a tag, recipe, or advancement). When it throws an error ALL data files do not get loaded.
-
You still need two functional blocks. A top half and a bottom half and you don't have two halves!
-
What does the upper half of your block sit on top of? Is it farmland? When your crop grows, I don't see it doing anything about setting an upper block. I don't see anything about the block knowing if its an upper or lower block. This is not the two-tall grass block class. This is the one-block grass block class (called "tall grass" because it isn't the grass block that has a green top face and dirt bottom face), which is why: That enum exists. Two tall grass cannot and never is "dead bush."
-
Use a DeferredRegistry or @ObjectHolder annotations.
-
fortune and silktouch enchantments when breaking blocks
Draco18s replied to Crare1's topic in Modder Support
Register an event listener for the BlockBreakEvent Inside, check the tool used to see if it has your enchantment If so, modify the adjacent blocks (note: if you intend to break and harvest adjacent blocks, you should either invoke the same pathways that items do, or broadcast the related events yourself, in the event that another mod or effect wants to do anything. For example, a permissions mod that prevents a player from breaking blocks in regions they don't have access to because it is owned by another player. Be aware of recursion!).