#help-development
1 messages · Page 470 of 1
Oh ok 🙂
no enter bed
WrappedDataWatcher w = WrappedDataWatcher.getEntityWatcher(p).deepClone();
w.setObject(6, EntityPose.SLEEPING);
w.setObject(13, Optional.of(b));
lol
Im making a broadcast message and i have this:
My code:
redeemMesage = PlaceholderAPI.setPlaceholders((Player) sender, redeemMesage);
redeemMesage = Utils.player(redeemMesage, sender.getName());
Bukkit.getServer().broadcastMessage(ChatColor.translateAlternateColorCodes('&', redeemMesage));
redeemMesage in config:
reclaimBroadcast: "&e{player} &fjust redeemed his %vault_prefix% &fperks! /reclaim!"
I dont know how to fix that... Someone help?
ive tried with %vault_prefix% and %luckperms_prefix%
i understand that it is not being compatible with hex code.
prefix: &7[	c00fbNa02fcoᜏfex๹ff+&7]
declaration: package: org.bukkit, interface: Server, class: Spigot
use components instead 🙂
should most likely resolve your issue with hex
k
wait what does that do?
its not complete, but if you find the right packet this makes them sleep
do you have to use craftbukkit to do that?
because most of the solutions to it do.
seems you mis-understand the implementations
yeah
wait i forgot so spigot is built on bukkit?
correct
ah ok.
when i try to import craftbukkit stuff though it doesnt work?>
because stuff has changed
wym?
whatever guide you are reading is most likely not up to date with the given mc version
no i dont mean like copying code or anything i mean the import line throws errors
therefore, its not going to be 100% translatable and you will have to do some research to figure out what changes need to be made
oh ok.
ah ok.
wait so can you send packets with only bukkit?
not sure what you mean
i mean can you send custom packets without craftbukkit
yes but also no
its better to just say spigot, since CB is not developed really anymore
oh ok
spigot maintains CB but only for the purpose of the fact spigot is built on top of it 😛
ah k
you would need to hook into the network manager stuff in NMS to send packets. You can't use it to send Custom packets that the protocol isn't implemented with. And if you try to send a packet to a client without using the network manager, the client will either ignore it or it might crash. Exception being unless the client has a mod that would be listening for something like this.
oh ok.
ty
🙂
can you get the world of a chunk generator in the method generateNoise?
use FAWE's api to generate structures
how can you get the time alive of a player?
should you create your own tracker for it?
Entity#getTicksLived()
Uhm, is the glass plane not a thing in the 1.8.8 api?
sweet. does this count the time that the players are offline or no?
Only stained glass pane and then magic values for the colour
Also
?1.8
Too old! (Click the link to get the exact time)
how do you add the color values
Only the ticks while the player existed on the server
cool
but it doesn't reset on deaths does it
so i have to create my own tracker for that?
I dont remember. Havent used 1.8 in years.
Look up some stuff from half a decade ago.
alright
Should reset on death
Might also reset on rejoin. You should test that.
i will
does FileConfiguration.setComments(section, "comment") not work? It should work but doesn't do anything
yes it works, so long as the section exists
it doesn't reset on death or on rejoin
it's just the total time alive
FileConfiguration.addDefault("name", "value"); Does this create a section?
ive already fixed it, i didnt have a provider installed
however you can compare it to player.getLastDeath and I think that might be the solution
long timeAlive = System.currentTimeMillis() - (objective.getScore(player.getName()).getScore() * 1000);
nevermind
answer is in player.getStatistic(Statistic.TIME_SINCE_DEATH)
This wont work
why not
Because you are subtracting a relative time from a total time
this works just fine
i didn't know about player stats
lul
It's something weird. The comments only appear when I reload/restart the server for the second time
https://paste.md-5.net/acogicehih.cs
This is the code
don;t add default
add section
so set
remove your copydefaults line too. Don;t mess with defaults until you understand them.
the thing is that it overwrites it every reload/start with .set
How would I do it without .addDefault and .set then?
you don't use addDefault
default is just what it will offer IF the section doesn't exist
which is what I want really
I never want to replace anything the user has written if the user follows the correct format
I just want to generate a config first time for the user to fill and tweak
yes you want to add your data, by the looks if it's not already in there
then only add data if it's empty
which is exactly what addDefault does isn't it?
do you want to fill missing sections, leaving others intact?
yes
and in turn generate a full config with comments the first time or when they delete config
in that case, load the file, addDefaults, THEN copyDefaults and save
guys if i teleport a sleeping npc, will they stay in the sleeping pose?
Doesn't seem to generate the config. Is this right? https://paste.md-5.net/ozaraxaqom.cs
set the comments after copydefaults
What's the most efficient way to send data from one server to another? Does it require Bungeecord to be setup?
still doesn't add the comments on init
the comments should be there after it is saved
so between copyDefaults and save?
cuz that is what I have right now and it doesn't add them until I reload the server/plugin for the first time
yes add comments after copydefaults and before saving
yall know how servers like Hypixel skyblock keep track of players skill xp and stuff like that? they cant possibly have files for all that can they?
Database I think
is chatgpt breaking every 10 minutes now?
not for me
so a seperate server?
mongodb
Are you aware of how a database cluster works?
OKay, let's start from the basics
MongoDB is a Database Management Software
Which means it has the ability to create and manage databases
It exposes a port, and with certain credentials your application and log in and access a database
So you can, for example, say "Hello MongoDB, I'm this minecraft plugin and I want to store this player data"
and mongodb will reply "consider it done" type deal
And it will store that data to a drive and index it
So that you can later go there and say "Hey mongodb, what's the player data associated with the uuid <uuid>?" and it will spit out whatever it has
What's cool about mongodb is that you can cluster it
So you can have multiple mongodb servers working together
and they can all keep track of where all of the data is
wouldnt that slow down the process of getting certain data
yeah that's what I thought
slightly, but as long as your connection between database machines is good enough then it shouldn't be a problem
ah okay
MongoDB isn't focused on the lowest latency and highest performance, but rather it's robust data structure
If you want extra fast performance, you can use Redis as a caching layer
Honestly storage time across redis and mongo aren't that different
but read times on redis are quite faster
guys how can i add craftbukkit to my plugin?
guys can anyone tell me if theres a real risk to use /reload on a mainly vanilla server with just my own plugin testing on
since it doesnt seem to affect anything
(compared with /stop)
Anyone know how to set a custom range for mobs? I have been searching for a long time and have found nothing.
I don't think you can, since vanilla pathfinding won't allow it.
/reload can be a bit leaky but if it's just your personal plugin with nothing major then you can
you mean for vanilla pathfinding?
hmm, would API dependencies still load correctly? I'm using placeholderapi, TAB, citizens
just for plugin support
lol alright
I am using paper 1.19.2
yeah but the pathfinding is still vanilla
paper doesn't change that.
that's not how it works
Umm, ok thanks.
what are you trying to achieve?
yeah you can just fuck with attributes from what I remember
anyone else like coding libraries that you know you're never actually going to use, but it looks cool when you use generics (it makes me feel like a pro)
I am creating a custom mob plugin, and I am trying to make the custom mob have a higher reach.
when you say range do you mean range as in reach, or range as in how far it can detect players from?
Generics 😭
I avoid them as much as I can
lmao
Reach
i use abstraction / interfaces for most of my projects
theyre useful now i know (sort of ) what im doing
I don't think you can change that either since it's also a vanilla mechanic, but if you're willing to change from that mechanic, you could add a custom damage system.
mlmao
This is the most useless spaghetti thing I've made recently
https://github.com/Y2K-Media-Creations/simpleconfigs
Only reason it exists too is because I hate how default serialized values look
They aren't human readable at all
Obviously there is an easier solution to this
Testing 1 sec
But I opted for the hard solution
lol nice, if that's spaghetti then mine is some gourmet type shit
you can play around and change it if you like NMS
The api looks nice but that's about all it's good for
is anyone available to join my 1.19.4 testing server for a sec, i wanna see if the past 2 hours has fixed somethjing
i have no friends
oh and since im lazy does anyone have an api for base attribute modifications like attack speed and movement speed with user friendly parameters like blocks per second or attack interval in milliseconds
does anyone know how i would create a nms plugin for 1.19.4?
Hello,
I am currently programming a plugin that changes the skin. After updating the new PlayerProfile via ProtocolLib, I currently have to teleport the player to another dimension for a short time so that the skin changes. Is there a more elegant way to bypass the teleportation?
I can't make it work properly It's a little bit advanced for me. Can you help me set it up?
Can somebody send me a link to a tutorial about how to create guis and stuff?
Thank you
hi , im new to plugin development and tried to set up a basic project in intelij idea , i added the spigot api with how the spigot api as a dependency but im still getting an error with anything that mentions bukkit or spigot.
Does it do item stacks
?bootstrap
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
Did you make it with the “Minecraft Development Plugin” on IntelliJ
what
There’s a plugin on IntelliJ that sets up all the jars for the plugin for you already
No problem just download it
@Override
public void run() {
if (spawnedCount < 15) {
Location spawnLocation = randomLocationNear(witherSpawnLocation, 10);
WitherSkeleton witherSkeleton = (WitherSkeleton) spawnLocation.getWorld().spawnEntity(spawnLocation, EntityType.WITHER_SKELETON);
ItemStack axe = new ItemStack(Material.NETHERITE_AXE);
axe.addEnchantment(Enchantment.MENDING, 1);
witherSkeleton.getEquipment().setItemInOffHand(axe);
witherSkeleton.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(50);
witherSkeleton.setHealth(50);
witherSkeleton.setCustomNameVisible(true);
witherSkeleton.customName(Component.text("§cWither Skeleton boss"));
witherSkeleton.setCanPickupItems(false);
witherSkeleton.setRemoveWhenFarAway(false);
witherSkeleton.setGlowing(true);
ItemStack sword = new ItemStack(Material.NETHERITE_SWORD);
sword.addUnsafeEnchantment(Enchantment.KNOCKBACK, 20);
witherSkeleton.getEquipment().setItemInMainHand(sword);
spawnedCount++;
spawnGlowingEffect(witherSkeleton);
}
}
}.runTaskTimer(this, 0, 100L);```
Someone go get alexs blog post
anyone know how i would set up a project using nms in 1.19.4 with intellij idea?
can i get a link? the only thing i found leads to a bad gateway
you'll need to override the getMeleeRange on the nms MeleeGoal
You can’t get it online there’s a plugin section on the IntelliJ app
?nms
?nms
you should use maven instead
what does maven change
it handles dependencies and building the .jar for you
yep, that's what I'd suggest. see the link above
alrighty
sorry for the dumb questions
also are there any other intelij plugins ya suggest using or just the minecraft development one
minecraft plugin development like
nukes your ram iirc
I still use it because I got a ton of ram and honestly don't care
but watch out for that
I also use github copilot, wakatime, Statistics
guys will
import org.bukkit.craftbukkit.*;
import all of the craftbukkit packages?

probably but why
just asking bc i imported it and i'm using things like "craftserver" and it isn't recognising it :/
oh god
But then the import would already not work
which it probably doesnt
yeah intellij
yeah i think so
is the import underlined red?
nope its grey which means it isnt being used :/
no errors
apart from when i try to use things from it
:/
then those things aren't recognised
maven or gradle
depending on spigot or spigot-api?
maven
i just imported craftbukkit
?paste your pom
doesn;t matter what you import if your dependencies are wrong
yeah thats what i was thinking
yep you are depending on spigot-api. That has no craftbukkit code
make sure to run buildtools
ah ok
Dependency 'org.spigotmc
1.19.4-R0.1-SNAPSHOT' not found
thats what it says :/
have you ran buildtools
how'd i do that?
?bt
?bt should all be explaned on here
will that fix it or what?
We shoudl really ask why you are importing craftbukkit, what are you trying to do?
access things like craftserver and craftplayer
but why
i keep seeing them in code which looks useful
for what reason
i'm trying to get an npc to enter sleep animation, and all code on the internet and forums uses craftbukkit and craftplayer
if there is an easier way to do that please tell me
unless you 100% can;t do it through the API you shoudl completely avoid CraftServer/NMS
:/
yeah i really want to avoid it
i just wanna use bukkit
What are you calling an NPC? Do you mean a villager?
I mean a custom player npc
is this custom player NPC from some other plugin?
I'm trying to make a plugin do display dead (sleeping) player bodies, similar to how it is done on hypixel/mineplex
No, I haven't started yet I just wanted to check it was possible to do before I did.
Citizens API has entered the chat
nah i don't wanna use that
do you think if i teleported a sleeping npc away from their bed the sleeping animation would continue?
unlikely
:/
can you send packets without craftbukkit?
oh ok :/
you will need NMS/CraftBukkit then
:/
CodeRed has a video on it which at a glance seems good https://www.youtube.com/watch?v=6LSScMdk0gU
ah ok ty
you still need to run buildtools though
That vids out dated as it's for 1.17
but it's only minor changes
all you have to do is spawn a fake player and set their pose
you don't even need a bed location
What are the conditions for a TreeSet to reject a value and return false on TreeSet#add()?
The documentation says
* the set contains no element {@code e2} such that
* {@code Objects.equals(e, e2)}.```
However, I get the following output:
[19:30:50 INFO]: [EventEngine] [STDOUT] Size: 1
[19:30:50 INFO]: [EventEngine] [STDOUT] Already in: space FullProtection
[19:30:50 INFO]: [EventEngine] [STDOUT] Not added: testarea FullProtection
When running this code:
```java
TreeSet<RegionEvent> regionEvents = eventListeners.get(event);
if (!regionEvents.add(regionEvent)) {
System.out.println("Size: " + regionEvents.size());
RegionEvent alreadyIn = regionEvents.stream().findFirst().get();
RegionEvent notAdded = regionEvent;
System.out.println("Already in: " + alreadyIn);
System.out.println("Not added: " + notAdded);
if (Objects.equals(alreadyIn, notAdded)) {
System.out.println("yes, equal");
}
}
The last part ("yes, equal") is never printed.
The toString() was just a quick test to get some reasonable result. It looks like this:
public String toString() {
return this.getRegion().getId() + " " + eventConfiguration.getId();
}
Therefore it is clearly visible, that both objects are NOT equal. I did not override equals() and hashcode() but there's no way they point to the same memory address.
I usually don't work with TreeSets so what am I missing here?
If it matters, this is how I constructed the TreeSet, does the Comparator also prevents equal insertions? Because the same priority can (and does) occur multiple times.
new TreeSet<>(Comparator.comparingInt(event2 -> event2.getRegion().getConfiguration().getPriority()));
did anyone know how to clear this menu or add some items ?
hmm does ::equals actually matters in a treeset or is it just ::compareTo == 0 that accounts for that?
packets
should look on wiki.vg
ok thank you
According to documentation they use Objects.equals(). But I'm starting to think that they actually use the comparator in order to determine whether entries are unique
If I run a Hub server and Game server where I want them both to access certain systems, should I just bundle all of my systems into an API and start making standalone plugins for both servers which use said API? Should I add the commands I develop to the API or should they just be added to both plugins as needed? Or should I just completely copy and paste the plugin between both servers?
Player#discoverRecipe() & Player#undiscoverRecipe() effects that menu. You just need to provide the recipies.
hmm i just modified it with packets 😂
i want to undiscover all items did you know how ?
Iterate over Player#getDiscoveredRecipes() and then just undiscover them.
Or actually
There is Player#undiscoverRecipies() that takes a list of recipies.
So just feed that method #getDiscoveredRecipies()
thank you (:
Depends on the use case i would say
Making a MMO where players can access their items from a Hub server. This would allow me to add things such as a marketplace or additional fun small resource demanding bits of content for players. In that case the Hub would need to have access to the custom Items system, for instance. However I may not want the Hub to have access to a custom Combat system.
anyone know how i can automatically start the dragon respawning
I was thinking it could be a good idea to just add the Item system to an API which is a library read in two separate plugins
like the DragonBattle class or smth
I'm trying to see which item I have in hand with .getItemInHand, I used it in the playerHitEvent event but it gives an error in the line where it says getItemInMainHand how do I do it?
Code?
Wait One sec
Hmm
Problem is I've never made an API and I don't know what the typical practices are for it. Would it be okay to add all of my commands to the API so both servers use them both? Should I just add the commands to each plugin separately? Not sure what the protocol is.
What is the error?
Probably use the same plugin but make toggleable modules, and store items in a database like mongoDB
I think that’s what I would do
Sorry for the mention, is there event for DiscoveredRecipies?
declaration: package: org.bukkit.event.player, class: PlayerRecipeDiscoverEvent
thanks (:
?img
Not verified? Upload screenshots here: https://prnt.sc/
or imgur
Or DM me :p
?jd-s
next time
check your dm
compare strings by #equals, not ==
I already tried it doesn't work 😦
id save some data into the pdc of that item, then check if its present within the config and create it
?pdc
I wonder when 1.8 servers will die for good. Sure, some people like the combat system of 1.8 but at this point that version is so old that 1.19 pvp servers probably still have more players
Never
what's mmc?
One can only hope that 1.8 will disappear completely if jeb ever finishes the combat snapshots.
Same lol
Mine man club
probably a 10 player server
Isn't there a gamerule to disable the hit cooldown?
No
attack speed attribute can be modified
"worlds biggest"
anyone know how i can start a dragonbattle as if someone placed the end crystals
Well then they probably don't like shields either
Yeah but you cannot block with swords anymore. Also axes would be OP and swords would be useless
You can fix that too
you don't need to fix any of that, its already nearly perfect
They all have windows 7 potato computers
Yeah I think the current system only needs a few tweaks
the pvp system for me is better than the versions since 1.9
Non supported mc version and non supported OS, kinda fits
Idk, I personally hate the shield warm up mechanic. That needs to go like it has in the combat snapshots.
when?
What is it that you don't like that cannot be changed with (at max) 1 day of coding
for me it is haha
anyone know how i can start an ender dragon battle as if someone placed the end crystals
no i meant when did we ask
Tell me why
It should automatically start if they place them no?
i need code that does it
automatically
doesnt need to place them
just do the anim
you could take a look at https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/boss/DragonBattle.html
but what
technics?
you can also hit blocks in 1.19
You mean mechanics?
The only tradeoff with 1.19 is that swords can no longer block. Everything else could be changed
look down and leftclick
DragonBattle#initiateRespawn() might be what you are looking for. It requires that the crystals have been placed though.
because its made to have instances probably

actuallly nvm
how would i do that
Actually, I think I misread the description. You may not need the crystals to be placed after all.
exactly what i need but it doesnt let me use the m ethod
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
That's because DragonBattle is an interface. You need to initialize it with an implementation.
ok got it
declaration: package: org.bukkit, interface: World
Then get urself an instance of the DragonBattle World#getEnderDragonBattle()
can i just do this
DragonBattle dragonBattle = ((EnderDragon) e.getEntity()).getDragonBattle();
and then dragonBattle.initiateRespawn();
No. It's a method of World, not an entity
It actually is part of the EnderDragon class.
Although I'd stick with the World method if it were me.
alright
Oh in that case it might work. I'd also use the world tho
I think it does require the end crystals still. I added those methods and last I recall it does require them.
A bit of a poor doc tbh
Try it without and if it doesn't work blame Choco 😛
Can probably be resolved by adding a new method that passes in a List<EnderCrystal>
Yes, make sure this code never runs in any other world tho. It will result in a NullPointerException
In the overworld maybe?
The dragon dies where admins want it to die lol
There are some creative survival mode players that have gotten dragons in the overworld before lol
There are also plugins that let you ride the dragon in the overworld.
I wrote a plugin that spawned dragon nests in the overworld
Maybe we get EnderDragon mob spawners in the overworld in 1.21 /s
I forget, did they fix that in the 1.20 snapshots? Or did they just reduce the number of them that spawn?
A firecracker 
@EventHandler
public void onDragonDeath(EntityDeathEvent e) {
if (e.getEntityType() == EntityType.ENDER_DRAGON) {
int delayTicks = main.getConfig().getInt("dragon-respawn-timer");
EnderDragon dragon = (EnderDragon) e.getEntity();
World world = dragon.getWorld();
DragonBattle dragonBattle = world.getEnderDragonBattle();
BukkitScheduler scheduler = main.getServer().getScheduler();
scheduler.scheduleSyncDelayedTask(main, new Runnable() {
@Override
public void run() {
dragonBattle.initiateRespawn();
}
}, delayTicks);
}
}```
didnt do anything
no errors either
Now you blame Choco for not mentioning the missing crystals in the documentation 😛
damn
No but seriously, you will need the 4 crystals placed. You can also do that using code
Probably not the same instance.
how do i get the location of the portal
doesn't it always spawn at x0 z0? And then at highestBlock?
Which is probably the smarter idea lmao
hello.
i have a question that might be far too unrelated for this server.
like outstanding unrelated probably.
very much not relevant.
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
does anyone know anything about nukkit for bedrock edition of minecraft?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
I know that it's also based on java so there's that. Besides that, no
i am trying to do something and i wanna create some communication between a java and bedrock edition server.
that has probably nothing to do with nukkit or anything else minecraft related
np
or do you mean something like geyser
if so just use it
this is kinda cursed
world1.spawn(new Location(world1, 0 + endPortalLocation.getX(), endPortalLocation.getY(), 3 + endPortalLocation.getZ()), EnderCrystal.class);
world1.spawn(new Location(world1, -3 + endPortalLocation.getX(), endPortalLocation.getY(), 0 + endPortalLocation.getZ()), EnderCrystal.class);
world1.spawn(new Location(world1, 0 + endPortalLocation.getX(), endPortalLocation.getY(), -3 + endPortalLocation.getZ()), EnderCrystal.class);
You're spawnning them relative to the corners
Not the center
Either add .5 to everything or use getBlockX or whatever it is to get a integer instead of a doubel
oh yeah
Of course it's allowed but just have in mind that means you can pass ANY object
Instead, make a interface to identify the objects you want, make those objects implement the interface
Learn
Cause what you're doing is a bad idea
I explained what you need to do, now it's a 10 minute read
In reality you actually want Abstract class instead of interface
But they both go hand in hand
What actual datatype are you wanting to be the Object GUI? @quaint mantle
I assume it's more than 1 because of your question
this is my code
Location loc2 = new Location(world, endPortalLocation.getX() + 0.5, endPortalLocation.getY(), endPortalLocation.getZ() + 3.5);
Location loc3 = new Location(world, endPortalLocation.getX() - 3.5, endPortalLocation.getY(), endPortalLocation.getZ() + 0.5);
Location loc4 = new Location(world, endPortalLocation.getX() + 0.5, endPortalLocation.getY(), endPortalLocation.getZ() - 3.5);
world.spawn(loc1, EnderCrystal.class);
world.spawn(loc2, EnderCrystal.class);
world.spawn(loc3, EnderCrystal.class);
world.spawn(loc4, EnderCrystal.class); ```
world.spawn(new Location(world, x + 3, y, z), EnderCrystal.class);
world.spawn(new Location(world, x - 3, y, z), EnderCrystal.class);
world.spawn(new Location(world, x, y, z + 3), EnderCrystal.class);
world.spawn(new Location(world, x, y, z - 3), EnderCrystal.class);
right
?gui
From my experience GUI with abstract class is easier and faster to implement. However Interface approach makes code more flexible and easier to maintain
Yes
What I sent is a guide, explaining everything you need to know
Don't just copy paste it... what's the point of the text in the guide then
Read what he does, then make your own
Show
int x = dragonBattle.getEndPortalLocation().getBlockX();
int y = dragonBattle.getEndPortalLocation().getBlockY();
int z = dragonBattle.getEndPortalLocation().getBlockZ();
world.spawn(new Location(world, x + 3, y, z), EnderCrystal.class);
world.spawn(new Location(world, x - 3, y, z), EnderCrystal.class);
world.spawn(new Location(world, x, y, z + 3), EnderCrystal.class);
world.spawn(new Location(world, x, y, z - 3), EnderCrystal.class);
this is my code
How far off
yeah
yeah
The 1 bedrock under
Yup
So, just clone the location and add 1 to the Y coord.
i already addyed
^
world.spawn(new Location(world, x + 3, y + 1, z), EnderCrystal.class);
world.spawn(new Location(world, x - 3, y + 1, z), EnderCrystal.class);
world.spawn(new Location(world, x, y + 1, z + 3), EnderCrystal.class);
world.spawn(new Location(world, x, y + 1, z - 3), EnderCrystal.class);
Clone it
Location#clone()
Always easier to work with
DragonBattle dragonBattle = null;
Location location = dragonBattle.getEndPortalLocation().clone();
int x = location.getBlockX();
int y = location.getBlockY() + 1;
int z = location.getBlockZ();
world.spawn(new Location(world, x + 3, y, z), EnderCrystal.class);
world.spawn(new Location(world, x - 3, y, z), EnderCrystal.class);
world.spawn(new Location(world, x, y, z + 3), EnderCrystal.class);
world.spawn(new Location(world, x, y, z - 3), EnderCrystal.class);
}
#setShowingBottom(false)
oh
That does seem to be weirdly centered tho
It's not even in the actual corner
Unless the bases of ender crystals are bigger than just 1 block
Location location = dragonBattle.getEndPortalLocation().clone().add(0,1,0);
world.spawn(location.clone().add(3,0,0), EnderCrystal.class);```
i dont know whats going on
Try with 1
try what
oh
simple to adjust then
But it's weird that it's not centered anyways elgarl
idk if the base is bigger than 1 block
yeah
Disable the base and try what elgarl said first, if using integers doesn't work ( Which would be weird ) play around with decimal blocks
those adds are actually doubles
ok
a crystal is somethign like 1.5 blocks in size (I think)
Then yeah gonna need getX instead of getBlockX like before,
Why are crystals 1.5blocks we will never know
so offset by 0.7 or so
its 0, 63.0, 0
add 0.5
^
to what
x
x and z
Try both but I think x and z
ok
you are currently spawnign it in the corner of a block
which is what the getBlockX returns
or all BlockPositions to be precise
so add 3.5 toi X and minus 0.5 from Z
oh ye
or plus, depending on which direction you are going
ye its plus
Elgarl
If I'm making a game and refining BoundingBox areas
What's a good way to do checks on the areas
I could create temporary regions with worldguard and use worldguardRegionEvents
refining? checks?
Like for example, so a player can walk into the area instead of needing a command
But prevent others from walking in, etc
world.spawn(location.clone().add(3.5,0,-0.5), EnderCrystal.class);
I don't think listening to playerMoveEvent is smart
are these areas random sizes or specific , like a set of chunks?
They are specific
It's literally a BoundingBox
@Setter
@Getter
private BoundingBox bounds;
yes but my question really was about the positioning, like, are they covering whole chunks?
No they are not
ok
but they expand to cover x blocks and not half blocks
ok do yoru own listener
for player move, changing blocks
yes, it's what worldguard will do
you ignore every move event that doesn;t result in teh player moving into a different block
you can do that really easily with math or just use teh events getFrom() and getTo() then getBlock() on each and check for ==
Yup
you can use == as it's an instance check because the block reference will be the same for the same block
👍
What datatype allows a list of unique values
Like UUID
So it can't have the same UUID added twice
Set<>
y’all
i just got a mf gig for some company
to create an android app
someone with commission experience help me find out what to charge
get a full project spec before negotiating price
did nms change the packet for player info because i was following a tutorial and the
ClientboundPlayerInfoPacket
doesn't exist
1.19.4
yes
do you know the name of the new packet?
when a player places an end crystal, is it a block or entity they are placing
Entity
oh k
ClientboundPlayerInfoUpdatePacket, ClientboundPlayerInfoRemovePacket and ClientboundSetEntityDataPacket
It fires the EntityPlaceEvent
so which one would i use to replace it
ClientboundPlayerInfoUpdatePacket playerInfoAdd = new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER, serverPlayer);```
hey guys, having an issue with a packet. https://gyazo.com/8ebcbe9c737ed583d2377bfe64c38396 - I'm trying to send packet with the animation id '1', but for some reason it's not showing the damage animation at all? I can get it to work for the other animations, has that damage animation changed or something?
https://pastebin.com/rHA22zcK using protocol lib
unless you are sendign skin info updates, then it's the entity packet
depends, can be air or null
some inventories return null, others return air
bruh the bukkit logger is so bad
depends how you grab them i think, if you grab contents, it will be nothing
iirc cant you addItem() and it returns a map of what it couldnt add
ItemStack type cant be null?
Correct
bruh
what's wrong here
i made a plugin with nms but when i load it into the server and run the command it errors can someone help
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
?paste
oh do you want me to paste the code?
this shouldn't be ItemStack == null instead of getting its type and comparing it to null?
Player#Spigot#sendMessage(ChatMessageType.ACTION_BAR, BaseComponent)
wait you weren't joking around?
just do == yeah
can anyone help i'm following a tutorial on making npcs with nms but when i add the plugin to the server it doesnt work
i wrote about it
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
?nocode
It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.
?paste
so i put the code in the paste and send u the link
yuh
it doesnt work when i run the command
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
when i run the command /npc i expect it to spawn a player but when i run the command it says "An internal error occurred"
which means u must have a stacktrace
so is the stacktrace the thing that is pasted into the console when the error occurs?
you should probably learn java. especially before you work with NMS
which is not doccumented
@river oracle is this what you were talking about: https://paste.md-5.net/udoruquheh.sql
wait a sec it says the plugin is disabled never mind thats useless
how about this: https://paste.md-5.net/ejocorogab.bash
also the way your doing your NMS isn't very maintainable
for version upgrades
you need to abstract everything into interfaces and different working modules
i don't mind that for now if i ever publish the plugin i will look into it
You really are jumping in at the deep end for your first plugin
deep end after tying 20 pound weights to your ankles
also how do i remap there is nothing in the link you sent about remapping
you just didn't read then I guess
that resource is everything you need to use mojmaps
I know its hard but you gotta read the whole thing
i read it but all i see is a pom.xml file and nothing at all about how to remap
would you prefer me to use the less understandable term
that pom contains everything to remap
reobfuscate
you need to reobfuscate your NMS code
to the default reobfuscated names
how would i do that
?nms
so do i just change the <goal>shade</goal> to <goal>remap</goal>
no, read the page
good luck ElgarL byyyyyy
I READ THE PAGE BUT I DON'T GET WHERE IT TELLS YOU HOW TO REMAP
you clearly didn't
dude you should not be working with NMS
You skimed it and saw a pom
start with easier stuff please
ok so do i change all the things in my pom.xml to the things in that pom.xml
except groupid and etc
no
THEN HOW DO I DO IT
read ALL of that post. everything thats inside the box
even the bit of text that is below the pom
no need for yelling 
how harsh
my ears were hurting
DO YOUR EARS STILL HURT
what do i base the price off once I’ve got the specs (I have them). I’m really worried i’ll low ball because this is my first professional development opportunity
you base it off what they want you to do firstly
🤓 actually I have a disorder that makes me hear normal things louder than they actually are so yes yes they do
be sure you get a FULL spec for the project and negotiate the price. No changes after it's finalized.
also don't let them just add stuff without paying more yeah what he said
Autistic?
Not diagnosed 🤷♂️
https://my.clevelandclinic.org/health/diseases/24320-hyperacusis
Hyper sensitivity?
finally i got it to compile correctly
thank you for the help
now lets see if it works
also sorry for the caps
How do you create parent of parents in Maven? Im really struggling with it
Oh Verano I actually needed you brother
Thank you
oh god not the slightest clue, probably in a similar fashion
Oh nice me too i need you too
haha
Lets go dms
okok i like that
so if they want anything added, add it and after everything they want is added then negotiate
people will often tell you what they want, then slowly alter it as time goes on.
oh I forget we want x in there too
Oh I forgot in addition to 1.19 it should also run on beta 1.5
Just get the full spec in writing and make it absolutely clear the price is for that spec. anything else you negotiate after.
alright thank you i appreciate it
Once you have the spec you should be in a better position to work out what you need to charge
i feel like the whole ordeal COULD go for some thousands ngl but at the same time i have no experience
does anyone know why this is happening:
[SuperiorNPCs] Enabling SuperiorNPCs v${project.version}
did you literally include ${project.version} in your source code
?paste
this is my pom file but idk why its doing that https://paste.md-5.net/semisiduti.xml
Cause you're not filtering resources.
how do i do that
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
ok
where would i put that in the pom.xml because if i add it just before the </project> it errors
It goes under your <build> section
ok
semver?
Semantic Versioning
what is that?
well what could it be besides string for semver
I see
Semver does have it's problems though.
It's rules are just about the numbers, but if you want anything else, like marking it with -ALPHA or smth similar it's not technically following the standard.
I guess
"A pre-release version MAY be denoted by appending a hyphen and a series of dot separated identifiers immediately following the patch version. Identifiers MUST comprise only ASCII alphanumerics and hyphens [0-9A-Za-z-]. Identifiers MUST NOT be empty. Numeric identifiers MUST NOT include leading zeroes. Pre-release versions have a lower precedence than the associated normal version. A pre-release version indicates that the version is unstable and might not satisfy the intended compatibility requirements as denoted by its associated normal version. Examples: 1.0.0-alpha, 1.0.0-alpha.1, 1.0.0-0.3.7, 1.0.0-x.7.z.92, 1.0.0-x-y-z."
Is this not that?
Custom object
Huh, guess it is. It's been a while since I last checked up on the standard though.
1.0.0 did have a similar rule but also required wanted a number after
Precedence SHOULD be determined by lexicographic ASCII sort order.
1.0.0-latest-fix.2-release
Hello, all! Is there a tried-and-true plugin for spawning in fake players for testing? There are seemingly dozens of plugins that claim to do so, but a lot of them aren't well-documented and most don't work on the latest versions of minecraft. Do you have ones that you use? Or should I just scrap that idea and use MockBukkit?
Mine turtle 🐢
anyone knows if it is possible to edit https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Player.html#showDemoScreen() (Player#showDemoScreen()) buttons?
declaration: package: org.bukkit.entity, interface: Player
damn
i want to change what they do
basically just disable the purchase button lol
how to load 1.19.x nms on gradle? 🔥
remapped?
yes
paperweight userdev
one sec
plugins {
id 'java'
id 'io.papermc.paperweight.userdev' version '1.5.4'
}
dependencies {
paperweightDevelopmentBundle('io.papermc.paper:dev-bundle:1.19.4-R0.1-SNAPSHOT')
}
if you do use paperweight just keep an eye for and paper imports
thanks!
if you use them wont work on spigot
hey, if I have a location and a direction as a vector, and I want to get the location x blocks in that direction (of the vector), how do I do that?
thanks (:
Anyone know if its possible to remove Skeleton Arrow Cooldown?
if not then just Vector#normalize()
Can you help me? I've been trying for a long time.
Machinegun skeleton?
Something like a 0.5-second delay
You'd need a custom entity I'd imagine
Does anyone Know how do imake npcs using nms all of the tutorials i found dont work
for my version
(1.19.3
I've already done the custom entity part. I am trying to create a skeleton boss.
does anybody knows how to modify offline player's inventory? (im going to use loadPlayer trick by loading the player and construct it, and calling loadData() function then get the inventory) is it okay? or??
No it is certainly not. There is no channel for advertisements on this discord. This channel is for development help only
any help?
my bad, never my intention to advertise was sending the link to showcase the homepage with the pictures and text we chose
still cool plugin
ty!
Sounds reasonable. If it works it works. Otherwise you'd have to change the playerfile manually or keep track of the inventory inside one of your own databases/files
Skeletons have a RangedBowAttackGoal with an attackIntervalMin, you can try to modify that
I will try thank you
((RangedAttackMob)this.mob).performRangedAttack(var0, BowItem.getPowerForTime(var5));
this.attackTime = this.attackIntervalMin;
looks like after firing their arrow this is set back to the given time and therefore it seems to be the cooldown
what is PlayerInteractManager in mojang mappings?
nvm
use this to figure it out
you can search through many mapping types and find what the values are in each
if you are used to Spigot or Yarn Mappings make sure you choose those accordingly
Thank you so much holy shit this helps
the fact not everyone knows about this is so tragic
I love you!!
I'll book you guys a room 🤔
As a developer you are always in love anyway, with your code that is
are you secretly not a dev and you make chat gpt code for you
Wtf rigged
if you are a developer you hate your code you comment how shit it is all the time and leave
Wtf double rigged
It always starts with friendship
You guys are leaving comments?
(Only if it's a very un-decipherable method)
comments everywhere. every line
Comment to explain your comments
player.teleport(player.getLocation()); // teleports the player to it's own location
The best kind of comment
I can't make this work properly.
while(player.getLocation().equals(player.getLocation()){ // welcome to hell
player.teleport(player.getLocation()); // return back to hell
} // good job you left hell
Lemme see
that actually breaks my brain
😭
but in all seriousness, who actually leaves comments?
Me when I need to vent anger with my code
Either have a descriptive but short name for your method or just make it easy to read lmfao
// filled via reflection at start of server
private static ActionLoader loader;
I actually left this comment to explain why a private static field never gets a value lol
for example
// fuck paper
@SupressWarnings("deprecated")
GameManager.getPlayerManager(); // Holy fuck I need to redo this why the fuck is this all static whoever wrote this is stupid
from my job
btw
when I worked for that server I wrote a whole game engine 😭 cuz the last people didn't know how to not abuse static
Or the obligatory TODO comments when you are to lazy to do it now and then forget about it for ages
public String getDocumentation() { // TODO
return "This is temporary and should be abstract and in every event with its own documentation";
}
public static Main instance;
I have no idea where to start. I am trying to make every skeleton have a shorter shooting delay of 0.5 seconds.
💀
Lmaooo true
But at work my favorite type of comment is one that describes a function - a function that was changed years ago and nobody ever bothered updating the comment. Even better when the comment got updated with // TODO adjust comment to reflect changes to function
💀
Did you ever work with nms and pathfinders/pathfindergoals before?
I thought I could do it using the Bukkit API.
Nop there's no way
Ok thank I will try reading about nms
I think I watched this back in the day when I made an angry flying pig
https://www.youtube.com/watch?v=Fnonn5chXk4
Custom pathfinder goals is here! I went very in-depth the best way I could to explain how custom pathfinders work. I hope you all enjoy and understand the video :D Thanks for watching!
P.S
Sorry about the damn zombie noise in the background forgot I had my mc sound on :(
Want more videos?
Become a Patreon support to gain access to more videos!...
pets :D
I should drink rum
Okay jack sparrow
ask choco for hlep
It's difficult to implement support for vanilla goals, which is what most people would probably use them for
Big boy factory class
ah
Is it possible to make a skeleton that doesn't miss using bukkit api, or will I also need to use NMS for it?
CraftCraftEvilFactory
💀
Using velocity you could make homing arrows
I mean how many of the vanilla goals would people actually want
💀
Who is gonna use the bee goals
it was so bad you needed like 10 classes toghet for any of it to function
and the classes weren't even named properly
no fucking way
I want my pig to hop into a Beehive and produce honey, wdym?
that's actually horrible
tf?