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?
#(KamikazeJA) Moving a MythicMob
148 messages · Page 1 of 1 (latest)
(KamikazeJA) Falling Block Packets (ProtocolLib)
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>
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)
I've tried looking at
https://wiki.vg/Protocol#Spawn_Entity
And https://wiki.vg/Object_Data#Falling_Block
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...
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
I'll try that
I also thought of maybe using a ModelEngine entity with textures that just look like the block
lol
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
!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...
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
are you sure it's 1.20 or is it 1.19.4
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
i think a lot of us are unaware of which of the two it actually targets
i was hoping you'd inform me 
can you help me with this mob issue?
it doesn't if it's a mythicmob
if you would that may help yeah
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]>
im confused now
is this a denizen question or is it too offtopic to categorize it as a denizen issue
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
mythicspawnandwalk - 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
we hired someone to write it
can we ask who?
Sure, Duak#1884
do you have their id by chance
1069455452695429145
Never Seen That User
User (null) does not have any known names (never spoken here).
something that works*
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
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
if you're familiar with java, you'll pick up how to learn and use Denizen easier than most users
!getstarted
Hey there! Welcome to Denizen!
To get started learning Denizen, we recommend you follow the beginner's guide: https://guide.denizenscript.com/
Also, feel free to browse scripts or view discussions on the forum: https://forum.denizenscript.com/
And of course... don't be afraid to ask questions here on this Discord!
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
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...
this is the commend used to make entities navigate via DenizenScript
there's usage in your script as well as examples here:
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)
!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>
t
you may alternatively want this:
!api
+++ Info api: https://wiki.citizensnpcs.co/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.
yea but at present, the entity in question is a MythicMob
Which I believe is being passed to the walk command, where it works
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
If that's the case, it sounds like the walk command supports any entity
Afaik
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
Click the blue text here
Convienent link to source can be found there
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
Check line 202
Oop didn't load
But yeah you were just slightly in the wrong place
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
even something like animated holograms or other sophisticated stuff
Or, well
stuff i'm currently using nms for
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
Need to leave for now, will continue this conversation in the morning if nobody picked it up by then
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
^ 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
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
Resolved
Thread closed as resolved.
Thread Reopened
Thread was manually reopened by @frozen fiber.