#help-development
1 messages · Page 590 of 1
Dude I have work to do and I can't keep delaying it more
Okay just sun it up in like 2 or 3 sentences
Its for 1.8 so i cant
Trust me pro gamer move time
something something fully player driven economy
something something custom biomes, mobs, items
something something world limit
something something something
Just do with :
heh, relatable
CuriosityCore is proud to announce that, thanks to @quaint mantle we have been inspired to make a plugin with a big custom resource driven world, with hard to kill mobs, unforgiving custom biomes, items, and a fully player driven economy based on region locked resources.
Mythic Realms!
Mythic Realms will be fully open source and have a strict not-for-profit licence. To ensure the concept will be easy to implement and never be used by bullshit peddling entrepreneurs. 😎
It will be now
Sounds like a cool project
So should i just replace { with :?
Shame about it getting a non profit licence
you should learn java dude
stop asking trivial questions and try google
?java
?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.
Howd they react lmao
He didn't see it I believe
Damn someone tell.him
or just didn't really react
I'm sad now lol
"Isn't that something curiosity core have just announced they are gonna make"
Lmao
You are just showing me a new method and i dont know how the hell i am going to fix this
You showed me it..
just make a normal switch if you're on 1.8
I'm sure you can do that at least
'cause you can't use enhanced switch with that old java
I believe that was what they started with and then were told to use switch
not sure tho
Is this still the world shop guy?
a much fancier switch with no ugly break;
yea
USE A DAMN MAP AND CALL IT A DAY JESUS
It's a mutable list depending on number of worlds
Just use a map
Easy
they will probably start a survival, craft a map and them be confused and ask "what now"
Lmaoooo
pretty sure they are fresh to java
Who cares? You don't hand an apprentice a screwdriver to put 300 screws in cause they've never used a drill before
ye but teaching them advanced concepts will just get them confused even more I believe
you need a strong foundation to use those, and they can't even write else-if properly
Have em cut their hand and cry a few times
Tis how to learn
Aka: stupid questions = stupid answers
He wants to do a complex thing
Show him that he needs complex tools
Teaching em bodge jobs because the suitable method is too hard just fuels shit devs
As they learn early on "this is the way" when it really isnt
Hmmm I see your point
You don't build a house if you can't even build a chair
The first bit of advice u give the poor sod is "ur not ready yet chief"
you're full of analogies
I , on occasion, code too lol
But yeah I'm a lecturer. We live and breath analogies lmao
Tbh I've wanted to make a make series to learn java via spigot because every other series uses shit like case statements for stuff like tab completers and I'm like "MY MAN NOOOO!" 🤣
I have question.
What happens to player when he get killed while teleporting to another dimension?
I.e. server sends Respawn packet, then player get hit and dies and then server recieves Teleport Confirm.
And how Teleport Confirm works in general?
... I have no idea and that is cool as hell.
Go test it , report back, hell, make a spigot article about it
Go my mad little spigot scientist
Be free!
*best way to learn is try to teach it to someone else.
Imo ofc
And with funky edge cases like that, experimentation I'd ur best bet as I'd bet my big left toe noone considered that when making those events
hello, can someone tell me how am I supposed to check if a connection to a server fails using bungeecord api, such as /server server (let's say the target server has a newer version)
there's various events
like?
serverconnectevent is the one that gets fired and causes all the issues
i need to prevent it if the connection fails
thank you for solving your api fault i'd say
what
serverconnectevent would always be fired tho ?
yep
even if connection fails, gets fired and then serverkickevent gets fired one second later
yes ?
intentionally that is
the javadocs specifically state the difference between ServerConnectEvent and ServerConnectedEvent

The ServerConnectEvent happens way to early to even know if a connection fails
unless you want to invent time travel, this isn't going to happen lol
ooops sorry i mean serverconnectedevent
my bad
somehow i need to prevent failed connections in order to not fire serverkickevent
but still, how am i supposed to do something like that?
because it's firing serverkickevent that will cause more issues
special things that i'm doing on my plugin
?jd-bc
once a ServerConnectedEvent is fired the Player is assumed to be connected and will be passed to the relevant server
What issue is it causing?
well... itd be one hell of an invention if one succeeded!
Hi im trying to create a custom enemy. How would i be able to get a list of all players the enemy if facing. For example if the enemy is facing in the +X direction, select all players that are within 10 blocks in front, but like a width of 5 blocks (kind of like a range of sight)?
lots of math
And is there a lovely little library that has all the math done for me?😭
get all players in that world.
Check range of player to mob.
calculate angle to player relative to mob getDirection()
No lib that I know of
ohh okay that doesnt sound bad
it doesn't sound bad until you have to optimize it because it has to run pretty much every tick for every mob
well it's just a tiny bit of math, probably things the server does thousands of times per tick anyway
....mythic mobs
help please
Show me ur list of removeable and getHead
wdym list of removeable?
Ur getRemoveable
its here
Ok on ur getHeads Line 319. Arrays is an immutable list. Try to create new Arraylist and add ur resultat set into This list
well luckily for the functionality i need it for i dont need to do that:)
?
like that?
No
Like that
ˋ`ˋString[] result = rs.getString(…).split(…);
List<String> res = new ArrayList<>();
for(String str : result){
res.add(str)
}
return res;``ˋ
Sorry im on my phone
Tell me if u want explication
new ArrayList<>(result)
?
Why there's no plugins when there is, also no errors
Probably forgot your plugin.yml
That jar is looking real small
Its the same
yea i only added printing
i followed the tutorial and i think there is a plugin.yml
name: freakcore
version: '${project.version}'
main: com.freakcore.FCore
api-version: 1.19
``` that's my plugin.yml
Its ok ?
how is direction measured in minecraft?
a unit vector
ohh okay
1 = 1 block = 1 metre
so its not an angle?
wait.. so where does the jar goes now? to target or to out
when using maven
target
type?
org.bukkit.vector
wait, pls
how do make a mob not burn to death by the sun, not using an item?
now it works but what was wrong with my build
EntityCombustEvent
It was missing plugin.yml
So how would i get the vector tht an entity is facing
just cancelling it will work?
getLocation then getDirection
there is
Should, Ye
Well it wasn't in the jar
ohh okay ty
thanks bro, it works
any ideas how to disable the dropping of loottables if an player is fishing?
he should only get fishes and not bamboo, books or rods 😄
(data packs arent an option)
I have this wall in a prison escape server, i want people to be able to shoot projectiles through the wall, but i don't want them to move through it. Some kind of barriers only for the player itself. How could i do this?
Math
add imaginary boundaries that u check if a play moves through
if they are outside of said boundaries
u cancel the move event
okay i found out that it does include plugin.yml file but not the code
won't that be like very glitchy? like the same with worldguard deny entry. i am using this now for the safe zones when combat tagged but when players fight with each other they get glitched in the wall instead of the invisible wall acting like a wall
You could potentially do something with per player world borders
with bukkit util is there an easy way to turn a vector into a unit vector or do i have to do the math myself lmfao
.normalize
a unit vector is just a vector with a length of 1. any vector.normalize() returns a unit vector
awesome thanks
ty
okay i did everything again and now it works with my build
'combat.getXp() / (combat.getStarterXp() * combat.getLevel())': integer division in floating-point context
how can i fix this warning
That is a basic google java moment
Is there any sign input library, where we can read player's input from a sign, kinda like this https://www.spigotmc.org/threads/signmenu-1-16-5-get-player-sign-input.249381/ but it's close from achieving exactly like i wanted.
What is wrong with that thingy?
i haven't actually tested it but it allows player to modify any lines
i mean if there isn't any alternatives, i can use that no problem
Yea that’s how it works
I believe u cant restrict that
Anyone aware if theres a way to get aroudn the fact that PersistentDataContainer#set(x, y, z) enforces z to be the same type as the PersistentDataType x? I'm doing some fucky type erasure and want to just pass an object
for(Field field : this.getClass().getDeclaredFields()){
Class<?> clazz = field.getClass();
if (Modifier.isTransient(field.getModifiers())) continue;
String name = field.getName();
if (!PDCUtil.canUseDataType(clazz)) {
throw new RuntimeException("WARN: Attempted to serialize field " + name
+ " in class " + this.getClass().getSimpleName() + ". Add the PersistentDataType adapter to the PDCUtil registry to serialize.");
}
PersistentDataType<?, ?> pdt = PDCUtil.getDataType(clazz);
pdc.set(new NamespacedKey(plugin, PDCUtil.toCamelCase(name)), pdt, ???);
}```
said fuckery:
cant just do clazz.cast
use PersistentDataType<?, Object>
doesnt that negate the whole point of PersistentDataType then
well what are you going to store and why don't you know the type of it?
Hey not sure if this is the right place but this is my first time using gradle and the Minecraft Development plugin for IDEA seems to have generated 2 build.gradle files. Which one does it actually use?
just make that class implement COnfigurationSerializable, then use ConfigurationSerializableDataType from ?morepdc
Hello, I have a question,
p.getInventory().addItem(new ItemStack(Material.TNT));
the problem is that if the player's inventory is full he will not receive anything, and it is possible to ensure that if the inventory is full he will drop the rest?
Contravariance
private <T> void fuck(PersistentDataContainer pdc, NamespacedKey key, PersistentDataType<?, T> pdt, Object val) {
pdc.set(key, pdt, (T)val);
}```
i have found a hack
lmao
why not just use T val instead of Object val?
because i cant cast Object to T outside of the method
in the reflection method i just know its Class<?> and class#cast only casts to capture of ?
which will mismatch
Yeah because <?> is invariant to everything in principle
yeah
that method just enforces T is the same then cases val as T
its super hacky but in theory it will work because Object is always instanceof T
Yeah, I suppose as long as u don’t pass stupid objects to it ur self
hi, i have problem from gradle build on MySQL and i relocate it, it show mysql.cj after i compiled it on gradle
is IntelliJ doing being IntelliJ?
Hello, how can I set the persistence of a particle (the time before it disappears ?)java e.getEntity().getWorld().spawnParticle(Particle.BLOCK_DUST, e.getEntity().getLocation().add(0, 1, 0), (int) e.getFinalDamage()*200, .2, .2, .2, redstoneBlockData);
idk why it show like this
particles have a fixed animation cycle. Some you can alter teh speed is all.
how can I alter the speed ?
depends on the particle type. the data entry is sometimes speed
can anyone help this ?
when i applied MySQL
after check mysql lib class
it show like this
I'll search for BlockData
I use the redstone block data
you can not affect redstone speed
that was my first bukkit pull request lol
the javadocs for the data classes
can anyone help me on this
an old fact !
Looks good?
Hi,
if (e.getView().getTitle().equalsIgnoreCase(ChatColor.RED + "cstom gui")) {
I use it and if it's true I cancel but I would like its only to do if it's a slot in the menu and not in the player's inventory how to do?
I mean its relocated to be inside ur package, no?
Don't detect inventories by their name
i do relocate even un-relocate it
use a collection to store your custom inventories to detect them
yes but i learn spigot si so for now I find it simpler, but what else can I do without using the names?
i still get this error
so i suck at math but how do i check if a location is in between 2 other locations? (Like a boundary)
whenever you create an inventory, put it into a Set<Inventory>. then in the event, check if your set contains that inventory. (don't forget to remove them from the set in InventoryCloseEvent)
Looks good?
found it
i can use BoundingBox
and only to do if it's a slot in the menu and not in the player's inventory how to do?
so how do i fix this issue
this was my first time on Gradle one, normally i use Maven
just fix by reussy
?paste ur build.gradle
i think i found a bug with either java or reflection pog
no other way to explain it
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
Player player = event.getPlayer();
Component joinMessage = Component.text(Color.GRAY + "[ " + Color.GREEN + "+" + Color.GRAY + " ]" + player.getName());
event.joinMessage(joinMessage);
}
And It doesn't print text, but it prints an object
How do I make it to print text?
Is it just me or running java -jar BuildTools.jar --remapped --rev 1.20.1 --generate-source --generate-docs does not generate javadocs and sources for spigot? (I tried multiple times, deleting the downloads in .mv2, switching the order of parameters around)
it doesnt add them to .m2
best way to quickly create a void world which i can delete later?
@remote swallow you mean it generates them elsewhere?
it generates them in the folder buildtools is ran iirc
which directory of the BuildTools output?
The directory where it was ran
I see, in Spigot/Spigot-API/target
unless you specified otherwise
Its not in the root
Then it's not done yet
yes like that
There it is?
cuz i just first commuciate with Gradle Repo
oh we talking docs
tbf we could probably copy them to root
PR time choco 
why dont we just add them to local repo too
If we're doing --generate-docs and --generate-source, clearly the goal is to have access to them
Why does it not auto add it to the .m2? Or am I doing something wrong?
No clue
Oversight probably
Though you shouldn't really need them. The docs are online so Maven should fetch them automatically
Or, rather, you can depend on the Javadocs
local repo like what, sorry i just too new with gradle
local repo is .m2
How, yeah all I'm trying to do is have the javadocs for spigot. I've added:
idea {
module {
isDownloadJavadoc = true
isDownloadSources = true
}
}
Which does download all the javadocs for other plugins and dependencies of mine, but not for "org.spigotmc:spigot-api:1.20.1-R0.1-SNAPSHOT" for some reason
do you have mavenLocal in ur deps
yeah you do, it wont check the repo bc of maven local
Hello again, I ask my question again, in an inventory, how to cancel the event if the clicked slot is in the "added" inventory but allow the player to move other items in his player inventory?
So, is the order wrong or it does not matter. Don't I need mavenLocal for the local mojang-remap / nms spigot jar?
idk if the order matters, but if you want all of spigot or mojmaps you need maven local repo
I mean the component methods don't check for 128 char length but that's only because that's hard to do with components, but afaik the limit on prefixes and suffixes are 128 chars
Like that's a vanilla limit
No?
its easier to make a batch script or something to just download sources and javadoc jars and install them to ther epo
you said like this so how i can fix this btw
idk what you want to fix, you relocate com.mysql to com.reussy.development.libs.mysql
Can it support more than 128?
yes i do relocate like that
I'm confused your saying I need mavenLocal() for full spigot, but on the other hand, if I have it I can't have spigot-api javadoc?
In vanilla*
but after build the jar
this thing happen
for the javadocs you have to manually install the sources and javadoc jars from the repo and add them where needed
Hello guys in 1.19.2 i have one problem with spawn egg i need get type mob spawn from egg:
I used in old:
SpawnEggMeta spawn = (SpawnEggMeta) playerItemEgg.getItemMeta();
spawn.getSpawnedType() - is type spawned mob
and how now to get the name of the mob that will be at spawn? can anyone come across this?
yeah, thats its extra package
Could you perhaps try doing just a 129 char objective name in vanilla? It's possible that's a vanilla limitation. Though yeah if your issue is just that legacy colour codes count towards string length, probably resolvable with components but still limited to 128 chars
relocate 'com.mysql.cj', 'com.reussy.development.libs.mysql'
If it's not a limitation then we should remove that check
i need the jdbc one
Yeah that's fine
or not mysql driver won't load
spigot ships a driver, and you have hikari so idk why ur shading one
Yeah you shouldn't need to shade either a MySQL or SQLite driver, CraftBukkit does this already
well spigot 1.8.8 using MySQL 5 while my lobby using 1.16.5 it using latest Mysql version 8
and it cause an error
so i have to recode like this
'tx_isolation' varriable on Mysql 5 changed to 'transaction_isolation' on MySQL8
*sigh* legacy
well its legacy reason btw
if i running 1.16.5 with support 1.8 so Via plugins won't showing full scoreboard
?
u have example?
Bad idea with nms
why it doesn't work? It works until it reach "S2"
I'll take a look at server internals later to see what internal limits are
255?
I recall them removing limits for things somewhat recently
1.18 or something
I just thought there was still an upper limit
Well qre you right click a molbert
Don't forget your list is cleared during restart
yeah
.
Yeah, I know
Looks like this is not the optimal solution.
By default, Gradle looks for dependencies in the repositories defined in the repositories block. The order of repositories in this block matters because Gradle will try to resolve dependencies from the repositories in the order they are listed.
Reversing the order of my repositories fixed the issue. I now have full spigot + spigot api javadocs (without manual actions)
Yeah figured. I'll look again
is there a straightforward way to set the book in a bookslot for Chiseled Bookshelves?
can having a lot of event listeners cause lag?
probably way earlier. Unless they are all just "return;"
I don’t think the amount of listeners matter as much, more like the amount of EventExecutors, which if u use registerEvents() would create 1 event executor per @EventHandler method iirc
also you can call get once fyi
i cant send images here?
anyway is having 98% non heap memory usage PERMENANTLY a big problem?
or is it evidence of memory leak?
How can I find out which pixel the player clicked on on the map in the ItemFrame?
PlayerInteractAtEntityEvent includes the position you clicked
Should work for item frames
You can use that and some math to determine the pixel
lets just not get deep into errors and stuff but what could this mean? org.bukkit.event.EventException: null
Presumably something is null
read the stacktrace
That depends
But sounds a bit fishy
does it not let anything be null?
oh
why do you keep ghost pingng him what
i tought this channel is general
The what
preconditions
one minute
I need to check for all players in a specific zone every tick. Should I do this synchronously and async. I personally lean towards async, but I remember being yelled at for using async repeating tasks for something similar on here xD
Will the PlayerQuitEvent be called on server stop when the server makes all the players leave or not?
hello, i am currently learning the spigot api. I'm working on the menus, I'm trying to make a system where you can't move the top slots, but the bottom slots can, and when I take an item from the bottom to put it up it's supposed to be blocked (this is the case most of the time.) however, by spamming an empty box I sometimes manage to put the item. Is there a way to prevent this?
the only reason that would ever happen is if your checks take so long that the player can place an item in there prior to the event being cancelled
are you doing any heavy operations like a DB call?
oh no, it's a very light code and I'm in localhost
Doing this async may error if a player joins while you are looping the player list.
Hello, how can I set a display name on an ArmorStand ?
most of the time you would be ok, but in some instances it can error
maybe it's a "fail" that can't be blocked and the only way to block it is to not allow item movement on the 2 inventories?
is this the way to create floating text?
idk what this was meant to show from what alex wanted, wait for him to be here later and ask
text displays
yes
are you on 1.19.4 or higher
I am on
ah also, getClickedInventory can be either p.getInventory (bottom inventory) or
and what is the top inventory called?
use getTopInventory or getBottomInventory
so i can use it like this?
if (e.getClickedInventory().equals(p.getTopInventory ()))
and getBottomInventory is an alias of p.getInventory?
so i can?
yeah
okay,
and getBottomInventory is an alias of p.getInventory?
probably not an alias, but the contents would be the same
it would be better to use getBottomInventory in this case
idk if i can ask here but my github is being stupid,
this is my project rn:
and its like this in github:
it doesnt seem to update
yea
theres nothing left to commit/push
i even tried creating a new repository
didnt work
looks correct to me
okay, and do you have an idea for that?
I'm working on the menus, I'm trying to make a system where you can't move the top slots, but the bottom slots can, and when I take an item from the bottom to put it up it's supposed to be blocked (this is the case most of the time.) however, by spamming an empty box I sometimes manage to put the item. Is there a way to prevent this?
theres 2 folders called Core here
one with a capitalised letter
and one without
for some reason the one WITH contain my new stuff and some old stuff?
@remote swallow
I'm not looping through the player list. I'm using World#getNearbyEntities with a BoundingBox filters for players
you can;t access world async
I need to look at my code I've done this before
just didn't wanna log into gitlab
we had some standard thing built into our game engine for this, but its been a year since I've touched minigames
you may get a CME if a player joins or an entity spawns during your async call
why? do those getMethods not return a copy of the collection?
I'd have to look ig, but I feel like not returning a copy could have some weird affects if you append to the collection
you call is async so it's not on the main thread. Its iteratign the collections async
oh I suppose I was just thinking about the return value not about the actual method running
if those collections are modified while your async call is iterating you can cause a cme
fixed it... somehow
yeah my game code runs it sync. I'll stick with that. I guess I'll cache all I can in memory to reduce runtime impact
up (if someone have an idea)
?paste
I'm not sure what is wrong with my json. Also don't get what Gson is saying here. I get it wants an array but its an object, but where? I'm so confused
https://paste.md-5.net/dawapusijo.bash
https://paste.md-5.net/obunepiboy.json
so im making this queue system for my hub core plugin and i made an error somewhere but i was looking for quite a bit of time and still couldnt figure out what is wrong i know it is big pile of code but yeah i is readable at least
"made an error somewhere". What error?
?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.
bottom of page
does the JSON not show an object though?
https://paste.md-5.net/toduvonita.cs
your "armor" is an object, i.e. a map with 4 keys: helmet, chestplate, etc. { }
it should however just be an rray of objects [ ], i.e. without "Helmet" keys etc
how am I supposed to identify which armor piece is what then. I mean then you could have like 3, helmets, 0 chestplates, 4 boots or whatever
is there any active forum where people are requesting developers?
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
what type adaptor are you using?
I sent the type adapter for armor in my message
for itemstack its one I made
well it is quite a simple just a normal queue system nothing too extra ordinary or special i believe both classes for queue QueueManager and QueueData are written correctly but i strongly believe it is the problem with PlayerListener.kt and how im accessing functions from that class because i probably messed that up but it would be great for second opinion on that this error occurs on player join event and i showing up every second which means that the problem is inside of bukkit task timer again link to code so you can open it easier from this message https://paste.md-5.net/lisoyidota.cpp
oh havent seen. gotta go & pick up my boyfriend, he's moving in to my place today lol
alr have fun xD
i just have hard time with accessing function properly from different classes and most likely im just making new instance over and over and it just breakes the code so if someone with better knowledge could take a peak into code it would be great
nfalex are you here ?
no he has to leave
kk
@river oracle typically it’s based on the order of the items in the array
You’ll have to check with your type adapter to see which order it expects
wdym by thius
there isn't even an array anywhere
lol
its all objects
besides the enchantments
When setting up enums is there a way i could use values from a config file?
no. Enums are compile time constants
what other structure could i use instead of an enum
class
wait sorry thats a dumb question with no context lmfao
public static final fields
What
sTatIc Abosoo
Are you going to do some cursed codegen to make a bunch of fields based on a config
noooo
im pretty sure they just want to make a class for their config options
just like I have
+L?
What's wrong with an enum?
its just a bunch of final public fields
That's literally what an enum is
well yes
just be a fuckin nerd like coll is and have a class for the config that you create stuff with
but with a normal class its easier to fill those values
honestly just might not make it so custom values can be used, so no config. if i wanna make it customisable in the future ill change it
so meeeean
He's just jealous of it
he isn't in the mood today
oh i just call coll a nerd all the time
Cope
GO TOUCH GRASS
Go to school
wait epic is still goin to school
i mean his age
He's 14
fr?
L
russia
have you guys seen jump pads in hypixel skyblock? they get you from point a to b but not with a straight line movement, with a jump movement that exactly puts you in the place. does anyone have an idea whats the math behind it?(using position xyz of start and position xyz of end to calculate how much velocity should we add to the player to throw the player exactly at the end point)
i dont have the patience for that
bruh physics 5th grade
You throw a rock at vector A(x, y, z)
Where would it land if g = 10
now inverse the thing
in our country physics start from grade 10+ i think
any wikipedia article for that?
at first you need to find how gravity works in mc
if you dont know it, i dont blame you. you only give Jree fava lessons not pree fhysics lessons
russians
everyone?
ah shit here we go again https://en.wikipedia.org/wiki/Velocity#:~:text=Velocity is the speed and,Common symbols
this is 5th grade in my country (NRW in germany)
German
Social studies (geography, history, economics-politics)
mathematics
Natural sciences (biology, chemistry, physics)
computer science
English
2nd foreign language (from class 7, in some schools from class 5), usually latin, french or spanish
Art
Music
Religious Studies/Practical Philosophy
Sports
Elective courses: the school offers at least a third foreign language and computer science or a combination of subjects with computer science. It can also offer other subjects or combinations of subjects.
where do u live?
merica
my country is fucked by your country
Location start = jumpPadLocation;
Location end = new Location(world, x, y, z);
Vector vector = end.clone().toVector().subtract(start.toVector());
double flatDistance = vector.clone().setY(0).length();
double Y = calculateY(flatDistance);
player.setVelocity(vector.add(0, Y, 0));
// disable player's fall damage
public double calculateY(double distance) {
double Y = 0;
// do some math using mc gravity formula
return Y;
}
Hello, how can I orient a TextDisplay to a Player ?
thx
You want it to be constantly rotating towards the player? Just set the billboard to centered with TextDisplay#setBillboard().
okay thanks
org.bukkit.util.Vector or java.util.Vector
yes
yeah
anyone remember the Vector collection in java?
i remember it in cpp
it's like a shitty version of an arraylist
it has funny method
Hey how do you cancel item damage for swords? I did this but it only works for armor
@EventHandler
public void onItemDamage(PlayerItemDamageEvent event) {
event.setCancelled(true);
}```
I always wonder why people make such methods protected or private instead of public
I mean it could be useful sometimes
oh cmon @fluid river u left some math behind now i have to calculate it with Integrals i believe...
right?
i changed my code a bit
final version
okay
?
That should work fine for any item
Yeah thats what I thought too but its not for me
HOW do i calculate that using minecrafts gravity formula
according to the ai nerd its (dist * grav) /2
try it 🙂
okay we have the distance but we dont have the gravity.
some google said it's 13(real life is 9.81)
have you considered googling
try using 13.0
well, google is shit sometimes
double Y = (flatDistance * 13) / 2;
32*
oh
public class JumpPadPhysics {
//CODE PROVIDED BY JREE FAVA LESSONS BY NUKERFALL
private Vector getVelocity(Location start, Location end){
double flatDistance = Math.sqrt(Math.pow(end.getX() - start.getX(), 2) + Math.pow(end.getZ() - start.getZ(), 2));
double Y = (flatDistance * 32) / 2;
return end.clone().toVector().subtract(start.toVector()).add(new Vector(0, Y, 0));
}
}
there is a better method i posted above
double flatDistance = vector.clone().setY(0).length();
in case your start and end points are on the same height you can remove part with clone.setY(0)
It expects your armor to be an array of items, not an object like you have it. It expects it to be something like helmet is always array index 0, chestplate is always array index 1, etc
Why nothing indicates it should be an array
Armor in Minecraft is typically an array, and that’s why you’re getting the exception you’re getting
It’s expecting an array and receiving an object
But json doesn't hard program what minecraft thinks. Like I genuinely don't think gson cares about minecraft logic
thats crazy
Crazy? i was crazy once. They locked me in a room. A rubber room. A rubber room with rats. and rats make me crazy. Crazy? i was crazy once. They locked me in a room. A rubber room. A rubber room with rats. and rats make me crazy.
No, but whatever is reading the json is attempting to deserialize that field as an array
And it’s not
Why I'm so confused ugh gimme a second to get on my pc and give my deseralizer code. Ig I'll look at my deseralizers later
What happened to the BLOCK_BREAK packet? What is it now?
Block b = e.getBlock();
b.setType(Material.CHEST);
Chest chest = (Chest) b.getState();
Inventory inventory = chest.getInventory();
inventory.clear();
ItemStack potion = new ItemStack(Material.POTION, 1,(short) 16421);
for (int i = 0; i < 27; i++) {
inventory.setItem(i, potion);
}
nothing is going in the chest any ideas
ive found that its now BlockDestruction
2 questions,
is there a way to make parts of text in item lore hidden
is there a way to make mobs not despawn
I only see those options in ProtocoLib 5.0.0
- That is basically just PDC.
- Yes, setPersistent
Can't seem to find it here either https://wiki.vg/Protocol
hello, i am currently learning the spigot api. I'm working on the menus, I'm trying to make a system where you can't move the top slots, but the bottom slots can, and when I take an item from the bottom to put it up it's supposed to be blocked (this is the case most of the time.) however, by spamming an empty box I sometimes manage to put the item. Is there a way to prevent this?
i just found it here lol
Why is there a special packet for that
only block break related thing
Ah wait it probably shows the breaking animation
can sm help thx
update the state probably
ok ill try
@spare hazel i'm doin free physics lessons with my friend
wait for me
i'm gonna send you the results of our research
would chest.update() be fine
iirc yeah
doesnt work..
hey i have uuid of player and i want to get its username
bungeecord
how do i do that?
plugin.getProxy().getPlayer(UUID.fromString(PlayerUUID)
when i do this
if player is offline it does null exception
@Override
public void onItemPlace(BlockPlaceEvent e) {
// Change the block to a chest
e.getBlock().setType(Material.CHEST);
aHCF.getInstance().getServer().getScheduler().scheduleSyncDelayedTask(aHCF.getInstance(), new Runnable() {
@Override
public void run() {
Chest chest = (Chest) e.getBlock().getState();
Inventory inventory = chest.getInventory();
ItemStack potion = new ItemStack(Material.BEDROCK);
for (int i = 0; i < inventory.getSize(); i++) {
inventory.setItem(i, potion);
}
}
}, 1L);
}
i tried this but it just doesnt work
You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
Becomes:
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
can anyone help
?paste ( FOR ME )
so when i update to 1.20.1 do i have to change the api version my my plugin.yml or do i keep it at 1.20?
what event is fired when a player equips an armor piece?
done
making it a code block
my friend is getting this error whilst downloading my project to his pc:
org.spigotmc:spigot🫙remapped-mojang:1.20.1-R0.1-SNAPSHOT was not found in https://oss.sonatype.org/content/groups/public/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of sonatype has elapsed or updates are forced
and yes he installed build tools
yea cus u cant get an offline player's name like that
use smt like mojang api idk
you can keep it the same and itll work just fine. mine runs on version 1.19.1 and works on 1.20.1
nvm i used different method.
hey in my bungeecord plugin i have command /msg. somewhy when i type /msg and press tab list of player names does not appear.
how do i add tab completion like that?
if u know how to add a basic tab completion
just return all the names of the online players
idk how it works in bungeecord tbh
@spare hazel
can anyone help
Forgot the remap flag?
Hey. I'm trying to use #general message , but receiving The constructor HoverEvent(HoverEvent.Action, Item) is undefined
oh yea u need to add --remapped right?
did you import the correct item?
anybody know how mc acceleration works
i mean air acceleration
cuz when you shoot player forward, his speed decreases over time
Mc parkour wiki and regular wiki should have detailed information about that
it works barely
does the command args contain the command itself or not ?
no
/command it contains me
I need help with worldedit
it doesnt appear in my server
although it is in server files
and btw how can i make it so my other plugins can access my plugins data
oh ok
what kinda data
like getting a players skill level (int) or getting a jump pads location (Location, the bukkit one)
I'm not sure 😄 net.md_5.bungee.api.chat.hover.content.Item seems not to fit here
make an API
You need the other plugins to depend on yours so that they can use your methods
how?
its not gonna be publicly available btw
not even the plugin
Must common way is to create an interface with all the methods you want to make accessible
interface?!
And make an impl in your plugin
What's wrong with that?
what even is that
Learn java moment
are you actually asking what an interface is?
if so thats a big learn java moment like Olivo said
?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.
i mean its lowkey funny you know what an API is but not an interface
gtg bye
Ok. So that requires Item(String id, int count, ItemTag tag). But in provided example there is new Item(itemInHand.getType().getKey().toString(), 1, itemInHand.getItemMeta().getAsString()))), which errors as The constructor Item(String, int, String) is undefined. So am I using wrong import, or should i change itemmeta as string to ItemTag?
Interfaces
There are a number of situations in software engineering when it is important for disparate groups of programmers to agree to a "contract" that spells out how their software interacts. Each group should be able to write their code without any knowledge of how the other group's code is written. Generally speaking, interfaces are such contracts.
For example, imagine a futuristic society where computer-controlled robotic cars transport passengers through city streets without a human operator. Automobile manufacturers write software (Java, of course) that operates the automobile—stop, start, accelerate, turn left, and so forth. Another industrial group, electronic guidance instrument manufacturers, make computer systems that receive GPS (Global Positioning System) position data and wireless transmission of traffic conditions and use that information to drive the car.
k i found it
is there any way do disable this acceleration
that seems to turn into a very elaborate explaination, but sure
and is 1 meter = 1 block
yes
ok
1 meter is generally 1 block unless stated otherwise
if i give player a velocity 1.0
but in code its probably just 1 unit, since thats also how the world coordinates are defined
etc
Which is crazy because that means Steve is like 6'2" or 6'3"
well yeah the scale doesnt really add up in most cases
How so
should move him 0.4 blocks per tick
yeah that doc is kinda assuming xD
6'2" isn't too crazy for an adult
josh how tall are you
That's not the point
I mean the more concerning part is that he is also a meter wide
He thicc
BOI HE THICK
He can also carry an almost unlimited amount of weight
And survive an unlimited amount of pressure
Where am i returning false wrong?
When im using the command and dont have permissions it also sends /vagtshop
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!(sender instanceof Player)) {
sender.sendMessage("Only players can do this");
return false;
}
Player player = (Player) sender;
if (!(isPlayerInGroup(player, "testGroup1") || isPlayerInGroup(player, "testGroup2") || isPlayerInGroup(player, "testGroup3") || isPlayerInGroup(player, "testGroup4"))) {
sender.sendMessage("You dont haver permission to this command.");
return false;
}else{
if(player.getWorld().getName().equalsIgnoreCase("A")){
new VagtshopA().open(player);
} else if(player.getWorld().getName().equalsIgnoreCase("B")){
new VagtshopB().open(player);
} else if(player.getWorld().getName().equalsIgnoreCase("C")){
new VagtshopC().open(player);
}
}
return true;
}
}
or snad
thanks IntelliJ. But why is this not allowed?
Crazy? I was crazy once.. They locked me in a room, a rubber room.. A rubber room with RATS, and rats drive me CRAZY!!
Crazy? i was crazy once. They locked me in a room. A rubber room. A rubber room with rats. and rats make me crazy. Crazy? i was crazy once. They locked me in a room. A rubber room. A rubber room with rats. and rats make me crazy.
umm it should be allowed. I've used that a few times before and it has worked.
how do you find out what item got put in what slot in InventoryClickEvent? Like, if I want to know when somebody equips pants (leggings), how do I?
java said that
java documentation
doesn't seem to work at all in 2023.1.3 ultimate
does right clicking an item to equip count as an inventory click event?
Doubt it
Maybe anyone did [item] plugin by this way?
ItemStack itemInHand = p.getInventory().getItemInMainHand();
String itemName = getItemName(itemInHand);
advertisement = advertisement.replace("[item]", itemName);
TextComponent chatComponent = new TextComponent(advertisement);
chatComponent.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_ITEM, new Item(itemInHand.getType().getKey().toString(), 1, itemInHand.getItemMeta().getAsString())));
I'm using Choco's example from a few days ago, but for new item() it requires third arg to be ItemTag, while in example there is string
Use the ArmorEquipEvent library
https://github.com/JEFF-Media-GbR/ArmorEquipEvent/tree/master
you could use this.
Yes that one
sorry your question just brought up a question of mine.
extra dependencies?
youll have to add it as one yeah.
Oh no whatever will we do
he gives you a step by step how to do it tho.
It gets shaded anyway
man thats weird and I ghuess im not updating 😆
I don't want extra dependencies ehh
then you have to reinvent the wheel. By the way spigot is also a dependency
Well then you can waste time rewriting it yourself for no reason
Or you can wait until the author of the spigot PR for that event comes back
take classes from the depend then and inserrt them your self into your code.
spigot is a dependency, because I'm making a plugin for it
yeah and then do that everytime there's a new version of the lib lol
Or just shade it which is the exact same thing but without the manual effort
hey, he doesnt want extra depends … 😆
ah yeah i remember having this issue not too long ago
i think i outright ended up just printing the item name n forgetting abt hover LOL
Bruh 😄
forget if NMS was needed or something
Easy fix
Yeah, i'm trying to avoid NMS at any cost
@worldly ingot why your example wrong?
:p
private Vector calculateShootVector(int t, Vector vector) {
return new Vector(x, 16, z);
}
Vector shootVector = calculateShootVector(2, vector);
player.setVelocity(shootVector);
there might be a serializer rhat i just forgor about
anybody able to help me fix an error?
he goes exact same blocks up
ah, that speed limit
probably
its funny bc the vanilla limit is 100
alr how do i make player stay in air for like 4 seconds
how big should the velocity be
its interesting that (craft)bukkit reduces it tenfold
There is ItemTag.ofNbt(String nbt), but does itemInHand.getItemMeta().getAsString() return needed string here?
[11:34:38 ERROR]: Error occurred while enabling azBasics v1.0 (Is it up to date?)
java.lang.NullPointerException: null
at net.tonepvp.azbasics.AzBasics.onEnable(AzBasics.java:17) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[patched_1.8.8.jar:git-PaperSpigot-445]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:332) [patched_1.8.8.jar:git-PaperSpigot-445]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:407) [patched_1.8.8.jar:git-PaperSpigot-445]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:359) [patched_1.8.8.jar:git-PaperSpigot-445]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:318) [patched_1.8.8.jar:git-PaperSpigot-445]
at net.minecraft.server.v1_8_R3.MinecraftServer.s(MinecraftServer.java:408) [patched_1.8.8.jar:git-PaperSpigot-445]
at net.minecraft.server.v1_8_R3.MinecraftServer.k(MinecraftServer.java:372) [patched_1.8.8.jar:git-PaperSpigot-445]
at net.minecraft.server.v1_8_R3.MinecraftServer.a(MinecraftServer.java:327) [patched_1.8.8.jar:git-PaperSpigot-445]
at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:267) [patched_1.8.8.jar:git-PaperSpigot-445]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:563) [patched_1.8.8.jar:git-PaperSpigot-445]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_371]
Not sure what the issue is
shit
?tas
Tbf explains why he’s here
but also NullPointer
Paper wouldn’t help with 1.8 :p
oh hsit that's paper
pixie were you crazy once
getCommand("gmc").setExecutor((CommandExecutor)new gmc());```
is "gmc" registered in your plugin.yml?
is the command in your plugin.yml
🤦
Damn too slow
F
why are you casting "gmc" to CommandExecutor?
their goals are beyond your understanding
that only makes sense if they have another method with signature setExecutor(gmc) which they 100% don't have
\
So it should be like that:
new HoverEvent(HoverEvent.Action.SHOW_ITEM, new Item(itemInHand.getType().getKey().toString(), 1, ItemTag.ofNbt(itemInHand.getItemMeta().getAsString())));
that message wasn't a reply to your message lol

While I'm here, maybe anyone knows a method to retreive item names? It could be in english only, but i know that with some work is it possible to show name according to player language
TranslatableComponent(getTranslationKey()) should work, its what i use :P
Bruh why none of that are in spigot forums or any other website. I've spend whole day googling about it before, and here is all info
Thanks! ❤️
dont mind the null nbt hoverevent, i gave up half way through on item display lol
but now i shrimply steal ur code 
That was amussing to listen to. lol
damn someone actually uses my pull requested stuff lol
yeah lol
I was like "wtf is Translatable" then I remembered that I added that
ah, right, ItemMeta can be null
dont mind why its not in the actual Item constructor, was just typing it out to see
what does translatable component even do
getTranslationKey()
localized messages
XD
can you add custom keys
if not its kinda useless imho
its not fully useless, but kinda limited
thats probably only for the registered texts like color.blue that is in every language file(eg. en.us.json)
by my language i meant the language i have selected
yeah you can just add more stuff to the lang file, maybe mc will load it automatically
as long as mc knows the file, and it has the keys iirc mojank loads it
thats pretty cool though
thats free translation, if you are willing to ship with a resource pack*
free translation as in you dont have to write any implementation
yeah :P
You can indeed add keys with resource packs
do u need to copy the whole lang file over or nah?
No
are they namespaced
how does minecraft know the regular keys then
wdym
like whats the path for a custom lang file
ah
just like all of resource packs, it just adds on top of what minecraft already has
and replaces things you copy from mc
!nms
?nms
thx
How can i set an itemstack color? I want to make a leather chestplate black.
getting only outdated results from google...
thank youuu
should i round player location with math.floor or math.round?
For what
for storing a location for my jump pad plugin
whats it stored in
how can i use hex colors in my plugin
Map : Location, JumpPad
yeah, where are you storing the map or are you not storing it
yep i have this but how can i use them now in an message
in the main class
yes it is
where
How to effectively cancel an event asynchronously
no i thought you meant in the code but im gonna soon save it in yaml
so you mean p.sendMessage(HexCodes.COLOR_CHAR ); and then + the message?
you dont need to round it
save the location as it
set("path", location)
getLocation("path")
do you have maybe an example for me?
but i need to check if the player location=jump pad locatio
n
im making a hypixel skyblock like jump pad plugin
use #equals
then if the x is 69.420001 then the player has to be on that exact position
Convert to block locations and compare those
how?
ok
Hm. I can't seem to think a way how to set hover event only for replaced [item] part. Problem is that it might be at start, in the middle or at the end of message. Is there an method to replace with components? o.O
Yeah, that makes sense, but what if some player decides to write something like "hey [item] for sale anyone interested [item]?"
Split at [item]
And then combine it back together with the hover component in between each
or just use string.replace("[item]", ChatComponentString)
sure do love some json in chat
Yeah that won’t work
Armor set bonuses
can I get the source location from a PlayerChangeWorldEvent?
I want to store the position the player is in before entering a certain world
Should just be the player current location
does the PlayerFishEvent trigger when the player catches fish or when the player throws the fishing rod?
the current location is the player's new location
it has a getFrom but that just returns the world
hmm
but maybe thats all I need
since it probably saved what position in the world you were when you left
make a print statement and check. I'm not sure.
no its after
but
its fine, I can use teh playerTeleportEvent which does have a location
🙃
what is the event that is triggered when the player catches fish
Hi im trying to do a customConfig class. I made all metods but the thing is that I only want to Create a CustomConfig config and manage all with that. Here is the code: https://paste.md-5.net/kidomosoxi.cs
PlayerFishEvent
?configs
See this wiki page on how to use custom configuration files: https://www.spigotmc.org/wiki/config-files/
but that doesn't use YamlConfiguration
you just use config = YamlConfiguration.load(...
FileConfiguration is just a parent class of YamlConfiguration
has helper methods. I recommend using the try/catch for loading as the example does
like this: https://paste.md-5.net/obuwaruvub.cpp ??
no
Step 1 get rid of the static
Because that makes no sense it you’re trying to do a class out of it
this may not be the correct discord, but does anyone know if multiverse fires player teleport events when I move from one world to another? from my code it doesnt seem like it does
yes it does
okay
