#(KamikazeJA) Moving a MythicMob

148 messages · Page 1 of 1 (latest)

ionic stump
#

I figured i'd ask here because you guys have awesome support. I'm trying to spawn fake falling block packets, to give the appearance of a full block, but that players can walk through. However when I spawn it with ProtocolLib it appears as a shadow for a split second then is gone. Any idea how I can get it to stay? Or a different way I can achieve this?

raw dockBOT
#

(KamikazeJA) Falling Block Packets (ProtocolLib)

raw dockBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>

ionic stump
#
        double x = location.getBlock().getLocation().getX() + 0.5;
        double y = location.getBlock().getLocation().getY() + 0.5;
        double z = location.getBlock().getLocation().getZ() + 0.5;

        PacketContainer packetContainer = new PacketContainer(PacketType.Play.Server.SPAWN_ENTITY);

        // Set Entity Data
        int freeId = new Random().nextInt(Integer.MAX_VALUE);
        packetContainer.getIntegers().write(0, freeId);
        packetContainer.getUUIDs().write(0, UUID.randomUUID());

        packetContainer.getEntityTypeModifier().write(0, EntityType.FALLING_BLOCK); // With ProtocolLib this is how I set the type

        // Set Positions
        packetContainer.getDoubles().write(0, x);
        packetContainer.getDoubles().write(1, y);
        packetContainer.getDoubles().write(2, z);

        // Set the state of the block
        int stateId = net.minecraft.world.level.block.Block.getId(((CraftBlockData) location.getBlock().getBlockData()).getState());
        packetContainer.getIntegers().write(2, stateId);
#

this is the code I use to spawn the falling block (currently trying to make it look like a SlimeBlock)

small crystal
#

Why not use Denizen?

#

!c showfake

round sandBOT
# small crystal !c showfake
Group

player

Syntax

showfake [<material>|.../cancel] [<location>|...] (players:<player>|...) (d:<duration>{10s})

Short Description

Makes the player see a block change that didn't actually happen.

Description

Makes the player see a block change that didn't actually happen.
This means that the server will still register the block being what it was before the command,
and players not included in the command will still see the original block.

You must specify a location (or list of locations), and a material (or list of materials).
The material list does not have to be of the same size as the location list (materials will be repeated automatically).

Optionally, specify a list of players to show the ch...

vital ferry
#

a showfake would actually be solid for the targeted player(s), maybe a better approach to this would be spawning invisible armor stands equipped with the block on their heads

ionic stump
#

I'll try that

#

I also thought of maybe using a ModelEngine entity with textures that just look like the block

#

lol

vital ferry
#

no need to use meg tbh its a pretty simple task

#

that is, if it'll be static

hoary forge
#

in this scenario, if you want players to be able to walk through the faked blocks and have it entirely clientside, showfake wouldn't be the command you want

#

oh this is a super old forum post, my bad

#

ill just uh

#

!c fake

round sandBOT
# hoary forge !c fake
Cannot Specify Searched Command

Multiple possible commands: FakeItem, ShowFake, ShowFake, FakeEquip, FakeSpawn.

#
Possible Confusion

Did you mean to search for mechanism age?

hoary forge
#

!c fakespawn

round sandBOT
# hoary forge !c fakespawn
Group

player

Syntax

fakespawn [<entity>] [<location>/cancel] (players:<player>|...) (d:<duration>{10s})

Short Description

Makes the player see a fake entity spawn that didn't actually happen.

Description

Makes the player see a fake entity spawn that didn't actually happen.
This means that the server will not track the entity, and players not included in the command will not see the entity.

You must specify an entity to spawn and a location to spawn it at, or to remove a fake entity, specify the fake entity object and 'cancel' instead of a location.

Optionally, specify a list of players to show the entity to. If unspecified, will default to the linked player.

Optionally, specify how long the f...

ionic stump
#

I got it working with a fake model engine entity meant to look like the block

#

mad because 1.20 is adding something to do exactly that lmfao

#

I have a new question though, how on earth do I have a MythicMob/ModelEngine entity move where I want it to go?

#

I'm just trying to get this mob to walk to a location, but it appears that's a big task in nms, and I can't seem to find a mythic mobs method

#

We had another developer who specializes in making denizen scripts write us something
For specific reasons we need more control over it, and I don't know Denizen so I'm just trying to make it in a spigot plugin

This is the line in Denizen, so i figured you guys would know
- ~walk <[mob]> <[target].backward[2]>

#

(KamikazeJA) Moving a MythicMob

void perch
ionic stump
#

honestly not sure, it's in an upcoming update

#

Wasn't aware they were planning 1.19.4

#

How does this Denizen script even work

#

It uses "mythicspawn" and then calls a walk command

#

which it appears uses Citizens to manage moving the entity

#

It's a mythic mob confusion

void perch
#

i was hoping you'd inform me SCgrin

ionic stump
#

can you help me with this mob issue?

void perch
#

possibly, but

#

a mythicmob mob cannot be a citizen

ionic stump
#

precisely

#

so how does the walk command work

void perch
#

it doesn't if it's a mythicmob

ionic stump
#

laughs in currently working

#

i can send the script

#

it ties into a bunch

void perch
#

if you would that may help yeah

ionic stump
#

This is a snippet where it spawns

      #Spawn Drill
      - if <context.location.material.name.if_null[air]> == <server.flag[drill_materialSpawn].if_null[BEDROCK]>:
        - narrate "<&c>[Drill] <&a>Spawned Drill"
        - playsound <player> sound:ENTITY_EXPERIENCE_ORB_PICKUP pitch:1 
*       - mythicspawn Drill <context.location.up[1]> save:drill
        - define drill <entry[drill].spawned_mythicmob>
        - flag <[drill].entity> drillMob:true
        - flag <[drill].entity> fuelAmount:<player.item_in_hand.flag[fuelAmount].if_null[0]>

        - flag <[drill].entity> fuelcapBase:<server.flag[fuelcap-base]>
        - flag <[drill].entity> fuelcapLevel:<player.item_in_hand.flag[fuelcapLevel].if_null[0]>


        - flag <[drill].entity> robustLevel:<player.item_in_hand.flag[robustLevel].if_null[0]>
        - flag <[drill].entity> robustBase:<server.flag[robust-base]>

        - flag <[drill].entity> pulverizerLevel:<player.item_in_hand.flag[pulverizerLevel].if_null[0]>
        - flag <[drill].entity> pulverizerBase:<server.flag[pulverizer-base]>

        - take iteminhand quantity:1

This is a snippet where it moves the spawned entities

#-------------------
drill-move:
    type: task 
    debug: false
    script:
    - define mob <[1]>
    - define target <[2]>
    - announce "<&c>[Debug] <&7>Move to <&e><[target].formatted>"
    - flag <[mob]> is_Moving:true
*   - ~walk <[mob]> <[target].backward[2]>
    - flag <[mob]> is_Break:true
    - flag <[mob]> is_Moving:false
    - if <[mob].is_spawned>:
      - run drill-break def:<[mob]>|<[target]>
#

And a snippet that actually calls the move part (see last line)

    on tick every:40:
      - if !<server.flag[drillConfig_load]>:
        - stop
      - foreach <server.worlds> as:world:
        - foreach <[world].living_entities> as:mob:       
          - if <[mob].has_flag[drillMob]>:

            - if <[mob].flag[fuelAmount]> <= 0:
              - foreach next

            

            #If mob is in move queue
            - if <[mob].flag[is_Moving].if_null[false]> == true:
              - foreach next
            - define listBlock <[mob].location.find.surface_blocks.within[20]>
            - define target false

            #If mob is in break queue
            - if <[mob].flag[is_Break].if_null[false]> == true:
              - foreach next
            - mythicsignal <[mob].mythicmob> Idle source:<[mob]>


            #Find the suitable block of wall
            - foreach <[listBlock]> as:block:
              - define matName <[block].material.name.if_null[air]>
              - if <[matName]> == <server.flag[drill_wall1]> || <[matName]> == <server.flag[drill_wall2]> || <[matName]> == <server.flag[drill_wall3]>:
                - define target <[block]>
                - foreach stop
            - if <[target]> != false && <[target]> != air:
*             - run drill-move def:<[mob]>|<[target]>
void perch
#

im confused now

#

is this a denizen question or is it too offtopic to categorize it as a denizen issue

ionic stump
#

I re-used this forum thread I noticed I still had

I think this is mostly a Denizen question, but only because in my quest to move this damn mob, i'm confused how this script is doing it lol

#

I'm hoping If I learn how the script does it, I can do it in code, perhaps using Denizen or something

#

This was my thought process:

  • I can't figure out how to move this mob, the nms is tricky, let me see how our Denizen script does it (we hired someone to write it)
  • I notice it uses the commands mythicspawn and walk
  • I looked into the source for the walk command, and noticed it relied on Citizens npcs

Now i'm confused because it clearly spawns a MythicMob, yet still uses the walk command (and works) lol

void perch
#

we hired someone to write it
can we ask who?

ionic stump
#

Sure, Duak#1884

void perch
ionic stump
#

1069455452695429145

void perch
#

huh

#

@tulip hill listnames 1069455452695429145

tulip hillBOT
void perch
#

that's uh

#

interesting

ionic stump
#

why are we looking into them

#

lol

void perch
#

because like

#

you paid them to make you something

ionic stump
#

something that works*

void perch
#

but they have no evidence of even being a part of our community

#

no problems though, just looking out for you is all

#

if you paid for something, they honestly should bear the responsibility of owing you something that actually works

#

we're just here in your favor

ionic stump
#

It does work

#

I'm questioning my existence, as I am not sure how it is working

#

this is their github if you must know

#

Let me clarify

#

I do not know Denizen, I do everything in java and plugins (Something I am gradually regretting lol)
I'm simply trying to make a mob move to a location
A task that the script we got does very easily using the walk command in Denizen
However I noticed Duak spawned a MythicMob, and still used the walk command
Which is currently the confusing part

void perch
#

!getstarted

round sandBOT
void perch
#

i was, and still am, under the impression that who-ever sold you whatever they made in Denizen took advantage of you

#

that's the reasoning behind the questioning

#

!command walk

round sandBOT
# void perch !command walk
Group

entity

Syntax

walk (<entity>|...) [<location>/stop] (speed:<#.#>) (auto_range) (radius:<#.#>) (lookat:<location>)

Short Description

Causes an entity or list of entities to walk to another location.

Description

Causes an entity or list of entities to walk to another location.

Specify a destination location to walk to, or 'stop' to stop all walking.

Optionally, specify a "speed:<#.#>" argument to control the speed of the NPCs.

Optionally, specify "auto_range" to automatically set the path range for the walk instruction
(if not specified, an NPC will not be able to walk to a location outside of its existing path range, by default 25 blocks).
(Does not apply to non-NPC entities).

Note that in most cas...

void perch
#

this is the commend used to make entities navigate via DenizenScript

#

there's usage in your script as well as examples here:

ionic stump
#

what they sold us works perfectly

We were attempting to convert it to a java plugin, because I do not know Denizen
and we have needs for this feature to connect to existing java plugins (lots of external information needed moving forward)

void perch
#

!command walk usage

round sandBOT
# void perch !command walk usage
Group

entity

Syntax

walk (<entity>|...) [<location>/stop] (speed:<#.#>) (auto_range) (radius:<#.#>) (lookat:<location>)

Short Description

Causes an entity or list of entities to walk to another location.

Use to make the NPC walk to an anchored position.
- walk <npc> <npc.anchor[spot1]>
Use to make the NPC walk to an anchored position that may be far away.
- walk <npc> <npc.anchor[spot2]> auto_range
Use to make the NPC walk to an anchored position while looking backwards.
- walk <npc> <npc.anchor[spot3]> lookat:<npc.anchor[spot2]>
Use to make the NPC walk to an anchored position, and then say something after arrival, using ~waitable syntax.
- ~walk <npc> <npc.anchor[spot4]>
- chat "I'm here!"
Use to make a list of NPCs stored in a flag all move together, with a flocking radius based on the number of NPCs included.
- walk <player.flag[squad]> radius:<player.flag[squad].size> <player.location>
void perch
#

!api

round sandBOT
#
API

Citizens has an extensive API for working with NPCs. Make sure you always are using an up-to-date build of the CitizensAPI to ensure that your plugin works with the latest release of Citizens.

ionic stump
#

yea but at present, the entity in question is a MythicMob

#

Which I believe is being passed to the walk command, where it works

inland monolith
#

Are uhh

#

You sure behr?

#

I see no reason why passing an entity effected with mythicmobs wouldn't work

#

You couldn't pass the mythicmob object directly, but there's a tag to get the underlying entity

ionic stump
#

If that's the case, it sounds like the walk command supports any entity

inland monolith
#

Afaik

ionic stump
#

It may sound weird, but how can I make use of that, or make use of Denizen logic in a java plugin

#

to simply move an entity to a location

inland monolith
#

Convienent link to source can be found there

ionic stump
#

Yea I have that open

#

I may be missing something, I've tried mimicking the logic

#

and it appears to be built on the assumption the entity is a citizens npc

#

oh shit

#

i'm dmb

#

There's an entire else statement here for when it's not an npc

#

wow

inland monolith
#

Check line 202

#

Oop didn't load

#

But yeah you were just slightly in the wrong place

ionic stump
#

I took a dive into line 170

#

and then went down the npc rabbit hole

#

ty for the help, I can use line 202 (yay public access)

#

do you recon you could code an entire server with custom features

#

using entirely Denizen

inland monolith
#

Yes

#

Many of our users do lol

#

i do

ionic stump
#

even something like animated holograms or other sophisticated stuff

inland monolith
#

Or, well

ionic stump
#

stuff i'm currently using nms for

inland monolith
#

I have 4 plugins total lol

#

Yes

#

Denizen can do anything any plugin can

ionic stump
#

Denizen i'd assume is optimized

#

And while i'm sure you could cause lag with it if you did things poorly
What's the chance simply using Denizen for stuff would be more performant

inland monolith
#

Need to leave for now, will continue this conversation in the morning if nobody picked it up by then

inland monolith
#

a perfect denizen script is gonna be slightly slower than a perfect java plugin, but the latter is much harder to make, and they're basically identical in speed in all other situations

#

Performance is really a non-issue

faint nexus
#

^ Something a well-written plugin can do without any performance issues can pretty much always be done in Denizen without performance issues - and ofc we are always available to help in #1026104994149171200

dawn leafBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.

If not yet resolved, please reply below to tell us what you still need.

(Note that if there is no reply for a few days, this thread will eventually close itself.)

#

@ionic stump

dawn leafBOT
#
Resolved

Thread closed as resolved.

dawn leafBOT
#
Thread Reopened

Thread was manually reopened by @frozen fiber.