Jump to content
  • Home
  • Files
  • Docs
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.15.2] Custom Point of Interest For Villigers
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 2
IMleader

[1.15.2] Custom Point of Interest For Villigers

By IMleader, April 30, 2020 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

IMleader    0

IMleader

IMleader    0

  • Stone Miner
  • IMleader
  • Members
  • 0
  • 56 posts
Posted April 30, 2020

Hello,

I am trying to add my own Villiager.

In order to create its profession I also need to create its POI.

However, the constructor for PointOfIntrestType is private. Infact, 99% of the class is private. While I can use the differed registry to order things correctly, it obv creates an error when I try to instantiate the private class.

public static final RegistryObject<PointOfInterestType> MONEY_POI = POI.register("money_machine",
            // First #1 is the number of villigers who can use block at a time,
            () -> new PointOfInterestType("money_machine", getAllStates(MONEY_MACHINE.get()), 1, (SoundEvent) null, 1));
}

Above is how they are created, but, new PointOfInterestType is private.

Minecraft seems to create them with a function called func_226359_a_, however, this is also private. Has anyone got custom villagers working in 1.15.2?

  • Quote

Share this post


Link to post
Share on other sites

Boy132    4

Boy132

Boy132    4

  • Tree Puncher
  • Boy132
  • Members
  • 4
  • 47 posts
Posted April 30, 2020

I guess you need to make the constructor public with an access transformer.

  • Quote

Share this post


Link to post
Share on other sites

IMleader    0

IMleader

IMleader    0

  • Stone Miner
  • IMleader
  • Members
  • 0
  • 56 posts
Posted April 30, 2020
7 hours ago, Boy132 said:

I guess you need to make the constructor public with an access transformer.

Sounds great. No idea how it works tho, I've seen it work for private fields, but I have no idea how to make it work for constructiors.

  • Quote

Share this post


Link to post
Share on other sites

MyRedAlien43    0

MyRedAlien43

MyRedAlien43    0

  • Tree Puncher
  • MyRedAlien43
  • Members
  • 0
  • 37 posts
Posted April 30, 2020
2 hours ago, IMleader said:

Sounds great. No idea how it works tho, I've seen it work for private fields, but I have no idea how to make it work for constructiors.

Also want to know this

  • Quote

Share this post


Link to post
Share on other sites

Kriptarus    0

Kriptarus

Kriptarus    0

  • Tree Puncher
  • Kriptarus
  • Members
  • 0
  • 9 posts
Posted May 3, 2020

I'm getting the same issue about PointOfInterestType and VillagerProfession.

I wonder why the constructor modifier was changed to private in [1.15.2], there are some codes i saw in [1.14.*] that uses those constructors like they was public.

I found this topic interesting:

[1.14.4] Villagers Professions (Fix) & Trades

  • Quote

Share this post


Link to post
Share on other sites

Samaritans    0

Samaritans

Samaritans    0

  • Tree Puncher
  • Samaritans
  • Members
  • 0
  • 39 posts
Posted May 16, 2020

Following, I also have the same issue. Is there a designed way to make POIs or is AT the only way?

  • Quote

Share this post


Link to post
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.

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 2
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Wintersky20
      Modifying / Replacing Vanilla Blocks (1.16.X)

      By Wintersky20 · Posted 12 minutes ago

      Ok , I'll try it  Thanks for the replay I'll let you know if is working 
    • AurenX
      Modifying / Replacing Vanilla Blocks (1.16.X)

      By AurenX · Posted 17 minutes ago

      Note: I am using registry events instead of deferred registry so if someone chimes in on a difference that works better than listen to them. this method still works so i am yet to be motivated to change. I am able to replace blocks using the RegistryEvent.Register<Block>. I get the old resource location ForgeRegistries.BLOCKS.getKey(oldBlock); and set the custom block with that blocks registry location newBlock.setRegistryName(resourceLocation); ForgeRegistries.BLOCKS.register(newBlock); I also replace the Item (again i dont know if this is still needed as doing so still works so i have yet to change it)
    • Thorius
      I don't know how forge works

      By Thorius · Posted 27 minutes ago

      Did you run your server?  
    • Wintersky20
      Modifying / Replacing Vanilla Blocks (1.16.X)

      By Wintersky20 · Posted 29 minutes ago

      Ok guys .. So , I'm trying to replace a vanilla block in 1.16.4 but no luck! First I created a Workspace like I always do .. I created a block class for my replaced block: public class ExempleBlock extends CactusBlock /*just an ex.*/ { public ExempleBlock() { super(AbstractBlock.Properties.from(Blocks.CACTUS)); } } Then I tried to register it : First method( copied from an old 1.12 mod by rwTema ) @Mod.EventHandler/* not in 1.16*/ public void preinit(FMLPreInitializationEvent event) {/* not in 1.16 , I think*/ Block blockDietHopper = new BlockDietHopper(); ForgeRegistries.BLOCKS.register(blockDietHopper); } Then I tried to do this with a new registry event //from the exemple mod private void setup(final FMLCommonSetupEvent event){ Block ex = new ExempleBlock(); ForgeRegistries.BLOCKS.register(ex); } no luck Then I tried this : @Mod(ExempleMain.MOD_ID) public class ExempleMain { public static final String MOD_ID = "id"; private static final Logger LOGGER = LogManager.getLogger(); public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, "minecraft"); public static final RegistryObject<Block> BETTER_EXEMPLE = BLOCKS.register("exemple_block", () -> new ExempleBlock()); public ExempleMain() { IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus(); bus.addListener(this::setup); ExempleMain.BLOCKS.register(bus); } private void setup(final FMLCommonSetupEvent event){} } No luck   The idea is , I want to modify the TileEntity or the TESR for the vanilla blocks (ex: tools hovering on enchanting table , Nethar anchor GUI, Composter GUI, etc)   Note: I use IntelliJ and mdk-1.16.4-35.1.37   And Thanks for every topic
    • Mark74
      I don't know how forge works

      By Mark74 · Posted 33 minutes ago

      I dont have that folder, should i create it?
  • Topics

    • Wintersky20
      2
      Modifying / Replacing Vanilla Blocks (1.16.X)

      By Wintersky20
      Started 29 minutes ago

    • Mark74
      4
      I don't know how forge works

      By Mark74
      Started 1 hour ago

    • Klarks
      39
      [1.16.4] How i can open a container by clicking on my mob

      By Klarks
      Started Saturday at 09:56 PM

    • MKR0902
      0
      1.12.2 Forge Server Not starting with command arguements

      By MKR0902
      Started 53 minutes ago

    • Amazinwave
      0
      Amazinwave

      By Amazinwave
      Started 1 hour ago

  • Who's Online (See full list)

    • Thorius
    • Trynthlas
    • Rosy162
    • Jason_Whittaker
    • DoctorC
    • AubriTheHuman
    • AurenX
    • Wintersky20
    • Formal Feather
    • MKR0902
    • Montyfat
    • Microcellule
    • babyfarkmcgeezax
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.15.2] Custom Point of Interest For Villigers
  • Theme

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