Jump to content

Creating Custom Event 1.10


jredfox

Recommended Posts

Let's try this again I am going to ask this for 1.10.2 then....

 

I know you are suppose to extend the event class then register it with forge event bus. I don't know how your suppose to get the variables from vanilla and stop vanilla from doing it's function nor how/when to manually fire it. 

 

I need the event to fire upon creation of any tile entity into the world as a pre-initialization so I don't  use asm for removing tile entities. Then I need to grab variables... Tile Entity,World,BlockPos,BlockState. 

 

Basically I am asking how to create the event with it registers, when/how to manually fire it with a pre and post,grabbing vanilla variables, runs on server and client....

Link to comment
Share on other sites

35 minutes ago, diesieben07 said:

Same reply as in your other thread:

 

This time please answer all questions.

I am trying to make an event that fires pre-creation of a tile entity into the world. This would fire on both server and client so neither would crash? I need a custom event to replace invalid tile entities with my new tile entities. Although I removed the mappings /setblock ~ ~ ~ blockTileEntity crashes. This is because, I only patched it only for block place event which doesn't fire with world.setBlockState...

Link to comment
Share on other sites

Well I haven't written it for anything besides older versions and can't really port it to newer versions without this event thing...

 

Basically {EntityId:"id",mounts:[{id:"entityid"},{id:"entityid",EntityNBT:{nbtstuff} }]}

where EntityId is the top mob and mounts go from 0 to max index get created downwards. No there is two ways to create the spawnage,

A:create by name and use interface (no EntityNBT:{})

B: create by nbt if has tag EntityNBT:{}.

 

Vanilla can't support this so I just have to completly override it. I have reported several spawner issues like not supporting anything but, nbt with multiple index spawner but, they said it works as intended which can't be right since EntityId tag with no spawn data single index spawner creates it by name. So I have to patch the tile entity itself as well as the render.

 

Yes I want the furnace to have a bigger savetime as long that's hours of real game time smelting for charcoal block mod yay?

Edited by jredfox
Link to comment
Share on other sites

14 minutes ago, diesieben07 said:

What?

 

What is "dynamic logic"?

 

Replacing TileEntity registrations like this is a very bad idea, it will break. If you want to replace vanilla blocks, use the registry replacements to replace the whole block.

can't find out how to put the quote to the above comment . The answers why I need to make a custom event are above and are pretty detailed.

Link to comment
Share on other sites

3 minutes ago, diesieben07 said:

Yes, vanilla supports this just fine: https://minecraft.gamepedia.com/Chunk_format#Block_entity_format

 

The furnace saves it's time values as a 32-bit integer, meaning it can store values of up to 4,294,967,295 ticks. That is nearly 60,000 hours. Is that not enough for your purposes?

No it doesn't I dare you to try to create a dynamic mounted horse spawner that will spawn in different horses each time based on one index of mounted spawners. The answer is  you can't because, it's going to create them from nbt every time for either multiple index spawners or passenger tags

Edited by jredfox
Link to comment
Share on other sites

Just now, diesieben07 said:

You said nothing about it being dynamic. I suggest you create your own spawner for that instead of hacking around with the vanilla one.

I have that's why I am hacking around with the vanilla one. I have done my best and it's a complete mess that I refuse to do the same thing to newer versions. I had to create them by name use the interface and then put all that messy nbt tags into the riding tags for 1.7.10 and 1.10.2 it was a mess. 

 

It only creates them by nbt meaning it will be the same type every time. 

Link to comment
Share on other sites

Vanilla: shows pig on spawner for a second before reading it

Vanilla: creates same mob every time rather then by name if(multi index spawnpotential spawner, or spawn data spawner regardless of mounts)

Vanilla: doesn't support multi render mounted spawner system

 

Only way to fix said issues:

replace tile entity mob spawner with a new one extending it

create custom event on tile entity pre creation to remove invalid tile entities

 

You still don't believe me that I haven't tried this is why I am re-writing silk spawners because of the vanilla bugs that I no longer support / make work arounds for.

https://github.com/jredfox/silkspawners/tree/master/src/main/java/com/EvilNotch/silkspawners

Edited by jredfox
Link to comment
Share on other sites

4 minutes ago, diesieben07 said:

No, the "fix" if you want to add additional features to spawners is to make your own spawner block and leave the vanilla one alone.

Not possible otherwise silk spawners blocks would be modded blocks and when you leave your would your vanilla spawners would disappear with vanilla tags.

Link to comment
Share on other sites

4 minutes ago, diesieben07 said:

Yes, if you uninstall a mod the features of that mod disappear. Thats how modding works.

My thing is suppose to be able for vanilla map makers to make as well as modded features like mounted spawners

 

A: I plan on all tags being used in mounting when modded

B: I plan on having vanilla tags in the spawner for when the map creator leaves yes it will have the issues described as above.

C: map makers know of these issues already and would be happy to have a program make spawners them for them....

D: it would confuse the heck out of people to setblock mob spawner with the tags specified and get no output and doesn't work with silk spawners....

Edited by jredfox
Link to comment
Share on other sites

Just tell me how to do the event thing. I need to know more then just a tile entity event I need to create a custom lightmap event to so my mod could configure different mc version light maps based on the clients happiness 

Edited by jredfox
Link to comment
Share on other sites

3 minutes ago, diesieben07 said:

There is no clean way to replace TileEntities, it causes issues all over the place.

Don't do it.

I realized this after 8 hours of debugging this past week. 

 

Everything will run clean soon if you could tell me please how to create the event ASM needed? Is this the same for lightmap event?

Link to comment
Share on other sites

15 minutes ago, diesieben07 said:

We will not help you make a coremod.

Coremods are a terrible idea, especially if someone who has no idea what they are doing makes them.

 

If you cannot figure out how to write one, you are not the person to do so.

I don't like the fact that both the light map and the tile entity into the world should already be vanilla forge events. Why were these never done? 

Link to comment
Share on other sites

ZmL17.gif

  • Like 3

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

  • 3 weeks later...
On 9/2/2017 at 3:39 AM, diesieben07 said:

Because nobody needed them.

If you need them, file an issue on Github explaining your use-case or, preferably, make a pull request.

No it's fine I have to learn ASM anyways to revert the combat system if configured to do so. After I do this for older versions and learned asm I will then submit an issue.

Link to comment
Share on other sites

9 hours ago, diesieben07 said:

You don't need ASM for this.

Stop making a coremod.

Then how am I suppose to do this then you said so yourself events that hook into vanilla require a coremod.

anyways I need to remove tile entities. I tried print a list on world load and it said TileEntities:[] list was empty but, I printed it on tick event. Then it gave me some output. I need to know where this is happening at is it world.setTileEntity(...)? 
TileEntityList[net.minecraft.tileentity.TileEntityMobSpawner@557ed124, net.minecraft.tileentity.TileEntityChest@1b2b7e61] 

 

I found out that it's not one but, three methods I need to patch

addTileEntity()//patch tile entity parameter
setTileEntity()//patch tile entity parameter
func_147457_a()//patch tile entity parameter

Edited by jredfox
Link to comment
Share on other sites

On 9/2/2017 at 4:39 AM, diesieben07 said:

make a pull request.

 

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Your drivers are in a broken state, follow the guide in the FAQ: https://forums.minecraftforge.net/topic/125488-rules-and-frequently-asked-questions-faq/#:~:text=How do I update my drivers%3F
    • A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffc3fe22b60, pid=15228, tid=5140 # # JRE version: OpenJDK Runtime Environment Microsoft-8035246 (17.0.8+7) (build 17.0.8+7-LTS) # Java VM: OpenJDK 64-Bit Server VM Microsoft-8035246 (17.0.8+7-LTS, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64) # Problematic frame: # C [atio6axx.dll+0x192b60] # # No core dump will be written. Minidumps are not enabled by default on client versions of Windows # # If you would like to submit a bug report, please visit: # https://aka.ms/minecraftjavacrashes # The crash happened outside the Java Virtual Machine in native code. # See problematic frame for where to report the bug i have no idea why please help
    • Quick-Books is great with regards to coordinating your monetary data. You can decide to live talk with a specialist at Quick-Books to get the answer for your questions. You will actually want to get to the talk going to the landing page and call us +1855-210-1428.
    • Update: I managed to make the item not disappear after crafting, but it doesn't remove any durability. import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.enchantment.Enchantments; import net.minecraft.enchantment.UnbreakingEnchantment; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public class NuggetHammer extends Item { private boolean damage; public NuggetHammer(Properties p_i48487_1_) { super(p_i48487_1_); } @Override public int getMaxDamage(ItemStack stack) { return 54 - 1; } public boolean isBarVisible(ItemStack stack) { return false; } @Override public ItemStack getContainerItem(ItemStack stack) { ItemStack copy = stack.copy(); copy.setCount(1); if (!this.damage) return copy; int unbreaking = EnchantmentHelper.getItemEnchantmentLevel(Enchantments.UNBREAKING, stack); for (int i = 0; i < unbreaking; i++) { if (UnbreakingEnchantment.shouldIgnoreDurabilityDrop(stack, unbreaking, random)) return copy; } copy.setDamageValue(stack.getDamageValue() + 1); if (copy.getDamageValue() > stack.getMaxDamage()) return ItemStack.EMPTY; return copy; } }  
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.