Jump to content
  • Home
  • Files
  • Docs
Status Updates
  • All Content

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • _HungTeen_

_HungTeen_

Members
 View Profile  See their activity
  • Content Count

    9
  • Joined

    March 26, 2020
  • Last visited

    23 hours ago

Community Reputation

1 Neutral

About _HungTeen_

  • Rank
    Tree Puncher

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. _HungTeen_ started following [1.15.2] Structure gen wrongly [Solved] and [Solved] [1.15.2] Music Disc play sound with no distance limit February 14
  2. _HungTeen_

    [Solved] [1.15.2] Music Disc play sound with no distance limit

    _HungTeen_ posted a topic in Modder Support

    I am making a music disc Item named [Zombie On Your Lawn]. I can correctly use the disc Item to right click JuckBox, and it can play the right music. But When i leave the JuckBox Block for about 200 blocks away, the music is still playing.(normally, when player about 30 blocks away, the music will stop playing). Here is the code in ItemRegister. public static final RegistryObject<Item> ZOMBIE_ON_YOUR_LAWN = ITEMS.register("zombie_on_your_lawn", () -> {return new MusicDiscItem(0, () -> { return SoundRegister.ZOMBIE_ON_YOUR_LAWN.get(); }, new Item.Properties().maxStackSize(1).group(GroupRegister.PVZ_MISC).rarity(Rarity.RARE)); }); "zombie_on_your_lawn":{ "subtitle": "sound.pvz.zombie_on_your_lawn", "sounds":[{"name":"pvz:music/zombie_on_your_lawn", "stream":true}] }
    • February 14
    • 1 reply
  3. _HungTeen_

    [1.15.2] Invalid criterion trigger

    _HungTeen_ replied to _HungTeen_'s topic in Modder Support

    Thx for reply. I try it before, but still the same error. I even copy a trigger code from twilightforest, also failed. Idk if it is because i miss some important register.
    • January 18
    • 2 replies
  4. _HungTeen_

    [1.15.2] Invalid criterion trigger

    _HungTeen_ posted a topic in Modder Support

    I am making a new Criterion trigger called SunAmountTrigger. First I create SunAmountTrigger class like the default did : https://github.com/HungTeen/pvzmod/blob/dev/src/main/java/com/hungteen/pvz/advancement/SunAmountTrigger.java And then I register it in AdvancementHandler : https://github.com/HungTeen/pvzmod/blob/dev/src/main/java/com/hungteen/pvz/advancement/AdvancementHandler.java Here is the json file of the custom advancement : https://github.com/HungTeen/pvzmod/blob/dev/src/main/resources/data/pvz/advancements/sunny_days.json But When I run mc, I didn't see the advancements and got log like this: [m[1;31m[11:11:47] [Server thread/ERROR] [minecraft/AdvancementManager]: Parsing error loading custom advancement pvz:sunny_days: Invalid criterion trigger: minecraft:sun_amount I don't know why it's Invalid, tysm if someone can help me figure out.
    • January 18
    • 2 replies
  5. _HungTeen_

    [1.14.4] [SOLVED] Structure Spawn

    _HungTeen_ replied to BudRunBun's topic in Modder Support

    You can focus on the defualt code about how to correctly add structure. I will show you default desert_pyramid. one is addStructure this.addStructure(Feature.DESERT_PYRAMID.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG)); another is addFeature biomeIn.addFeature(GenerationStage.Decoration.SURFACE_STRUCTURES, Feature.DESERT_PYRAMID.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG).withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG))); So what you need to do is add "addFeature" method. I think addStructure means the biome can spawn the structure. addFeature means the biome can show the structure.
    • August 22, 2020
    • 2 replies
      • 1
      • Thanks
  6. _HungTeen_

    [1.15.2] Something wrong with my WorldSavedData [Solved]

    _HungTeen_ replied to _HungTeen_'s topic in Modder Support

    Ok,my bad . Its still a small mistake like last time. I forgot to break in switch 😅 Can I delete this topic?
    • August 20, 2020
    • 1 reply
  7. _HungTeen_

    [1.15.2] Something wrong with my WorldSavedData [Solved]

    _HungTeen_ posted a topic in Modder Support

    I am making a WorldEventData class to save my world event set. private HashSet<Events> events = new HashSet<>(Events.values().length); When I add event to the set ,it seems ok. public void addEvent(Events ev) { events.add(ev); // System.out.println(events.contains(ev)); this.markDirty(); } If I use code below to check wheather it add correctly,it output nothing (means the event did't add correctly) @SuppressWarnings("resource") @SubscribeEvent public static void onPlayerRightClick(RightClickItem ev){ // System.out.println(ev.getWorld().getDayTime()); if(!ev.getWorld().isRemote) { WorldEventData data = WorldEventData.getOverWorldEventData(ev.getWorld()); for(Events event:Events.values()) { System.out.println(data.hasEvent(event)); } } } Codes which maybe related. WorldEventData : https://github.com/HungTeen/pvzmod/blob/dev/src/main/java/com/hungteen/pvz/world/data/WorldEventData.java RightClickEvent : https://github.com/HungTeen/pvzmod/blob/dev/src/main/java/com/hungteen/pvz/event/PVZPlayerEvent.java#L83 The place I add event : https://github.com/HungTeen/pvzmod/blob/dev/src/main/java/com/hungteen/pvz/event/OverWorldEvent.java#L64
    • August 20, 2020
    • 1 reply
  8. _HungTeen_

    [1.15.2] Structure gen wrongly [Solved]

    _HungTeen_ replied to _HungTeen_'s topic in Modder Support

    ok,finally i know the problem. Im just so stupid ! public DaveVillaComponent(TemplateManager manager, ResourceLocation res,BlockPos pos, Rotation rotation) { super(IStructurePieceType.SHIPWRECK, 0); this.templatePosition = pos; this.rotation = rotation; this.res=res; // this.midPos=blockpos; this.setUpTemplate(manager); } I just forgot to change the IStrucurePieceType.SHIPWRECK which I copy from default code.
    • August 15, 2020
    • 1 reply
  9. _HungTeen_

    [1.15.2] Structure gen wrongly [Solved]

    _HungTeen_ posted a topic in Modder Support

    I am making a structure with 4 template pieces . Sometimes it gen properly like this. But mostly,it gen like this. here is the code https://github.com/HungTeen/pvzmod/tree/dev/src/main/java/com/hungteen/pvz/structure/davevilla and this picture maybe helpful.It shows the place of structure block. I have troubled a whole day. hope you guys will help me out. Thanks !
    • August 14, 2020
    • 1 reply
  10. _HungTeen_ _HungTeen_ joined the community March 26, 2020
  11. _HungTeen_

    [1.12.2]Multipart entity problem maybe about setDead

    _HungTeen_ posted a topic in Modder Support

    public class EntityConeHead extends MultiPartEntityPart{ private EntityNormalZombie zombie; public EntityConeHead(EntityNormalZombie zombie, String partName, float width, float height) { super(zombie, partName, width, height); this.zombie=zombie; this.setExist(); } @Override public boolean attackEntityFrom(DamageSource source, float amount) { //System.out.println(this.world.isRemote+" "+source.damageType+" "+amount); return super.attackEntityFrom(source, amount); } public void setExist() { if(this.parent instanceof EntityZombieBase) { if(((EntityZombieBase) this.parent).getIsInivs()) this.setInvisible(true); else this.setInvisible(false); } else { System.out.println("error parent!"); return ; } } public EntityZombieBase getZombie() { return this.zombie; } public void setBreak() { this.setSize(0f, 0f); this.setInvisible(true); } } public class EntityConeHeadZombie extends EntityNormalZombie implements IEntityMultiPart{ private final EntityConeHead cone; public EntityConeHeadZombie(World worldIn) { super(worldIn); cone=new EntityConeHead(this, "cone_head", 0.5f, 1f); } @Override protected void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(56.0D); } @Override public void onUpdate() { super.onUpdate(); if(this.getHealth()<=20) { this.cone.setBreak(); } else{ this.cone.setLocationAndAngles(this.posX, this.posY+1.5, this.posZ, this.rotationYawHead, -this.rotationPitch); } this.world.updateEntityWithOptionalForce(this.cone, true); } @Override protected boolean canDespawn() { return false; } @Override public void setDead() { super.setDead(); this.cone.setDead(); } @Override public Entity[] getParts() { return new Entity[] {this.cone}; } @Override public World getWorld() { return this.world; } @Override public boolean attackEntityFromPart(MultiPartEntityPart part, DamageSource source, float damage) { return this.attackEntityFrom(source, damage); } @Override public boolean isNonBoss() { return false; } } It's my first time to ask question at here.The problem is I am making a ConeHead Zombie by using multipartEntity ,When my peaShooter kill some ConeHead Zombie,there will exist some invisble object blocking my peaShooter's bullet.I know it may be the uncleared Cone,but I don't know how to deal with it.Pls help me ,thx !
    • March 26, 2020
    • 1 reply
  • All Activity
  • Home
  • _HungTeen_
  • Theme

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