#help-development
1 messages ยท Page 2117 of 1
about what
remake minecraft
weak
fuck we gotta put 86% of youtube in jail now
I remapped jar file, but I get four of them, and only two of them can work on my test server
They did not publish it probably
The only thing that wouldnt compile is this:
String msg = ChatColor.RED + ChatColor.BLUE + "post.";
Because this implies a concatenation of ChatColor objects
adding to strong is just making your code longer for no reason
toString
my phone refuses to let me type string
just use translate colour OMFG
why, why NMS remapping can give me so many different versions and not all of them can work
public static String getColor(String colorName) { return ChatColor.valueOf(colorName.toUpperCase()).toString(); }
*If the predecending context is of type String
or just use the ChatColor.valueOf method
tiny-remapper moment
i meant more like
public static String coloured(String text) {
return ChatColor.translateAlternateColorCodes('&', text);
}
getColor("red") would return ChatColor.RED.toString();
But technically it is just because that is the convention.
Anyone has an idea of a project?
Make math without mathh
wdym
make a programming language where the files are signs
Sucks
make addition/substraction/multiplication/division without +-*/
if im making a programming language ill make it a minecraft ide
permission distribution plugin like ESS
which isnt rly a coding language just a parser with reflection
2Hex make a java scripting language that compiles into java
I think I've saw someone did this before
Make a fruit tree plugin that uses heads as fruits and tracks their growth state inside the
PersistentDataContainer of the Skulls. Then use barrels and let the player brew different wines with the fruits.
ooo
thats a good idea
remind me of expand of slimeFun
There is so much content accessible for this already
Ahem
sorry, can't help, this question is too complex for me
Getters are thread safe as long as the returned object reference is immutable.
The server doesnt change so this method should be thread safe.
That being said in most cases plugin.getServer is equal to Bukkit.getServer
One moment im just seeing that server field is not final...
It's about org.bukkit.plugin.java.JavaPlugin.getServer
They are actually the same. One is just a static getter
Is it safe to use in async event handler or I need to use Bukkit.getServer instead?
If you run standard bukkit
I run spigot?..
Ok i checked. It only gets mutated when the init method is called. So it should be quite robust regarding thread safety.
Obviously, duh
Oh, okay, thanks
That being said most methods in that class are not safe to use in a concurrent manner
Can anyone gimme a plugin idea
Make a fruit tree plugin that uses heads as fruits and tracks their growth state inside the
PersistentDataContainer of the Skulls. Then use barrels and let the player brew different wines with the fruits.
Yarn go brrr
Oo nice
Ty
What do you guys have agains the mojang mappings...
Tech-tree like skill plugin that applies the tech tree on the entrie factions
Idk what tect tree is
like research
I have nothing against Mojmap
1 node leads to other nodes
Yeah, mojmap is not the issue
that unlock stuff
Except the legal issues with it
Why do you need a Server instance in an async context anyways?
That shit still makes 0 sense to me
perhaps the plugin manager
can you resize armour stands ? if so you could simulate plants growing with the heads
To do plugin.getServer().getPluginManager().callEvent(event). Is there a better way?
What legal issues?
I doubt it's a better way
You just put the item on their head and let them slowly rise.
And the rising fruit is just a greener head.
it's not
cant u just pass
the PM
yeah
instead of the Server
*plugin
Intelligence
as you do with like registering events
nms is paining me
This is fine.
Bukkit.getPluginManager().callEvent();
This is also possible.
But please make sure the called event is properly named. Something like AsyncPrePlantGrowEvent or something.
Nms is pain.
That is why one does not use NMS for no reason at all
I think they're just talking about events generally
that's what I am thinking
It is. That is just object name
It is more or less built to be painful
unfortunately, its the only way of making a snowball invisible
i've been trying for hours
yes, but sometimes we have no choice
There are always workarounds
Thats one for the "im bored" guys.
Expose the visibility in the API and make a PR.
For the snowball being invisible for example you can emulate the snowball
Ah, btw. What if I wish a new event to be synchronous? How exactly do I do that?
like I wanna create an anvil inventory, spigot API told me prorationNotSupport
Sorry for being annoying
?
Can someone help me with databases? I am trying to store coordinates
Simply call it from the main thread.
Mkay
WHAT
OperationNotSupportedException?
yes
I'm curious, what did you try to get it?
isnt ONSE pointless?
One usually does not see this exception
you can try it
like if you ever throw ONSE in ur program then ur breaking SOLID
It isn't from time to time when a method does not make sense
Yeah i usually also just emulate my own projectiles. This way im not bound to the weird physics constraints of minecraft.
Inventory inventory = Bukkit.createInventory(null, InventoryType.ANVIL);
player.openInventory(inventory);
use this to create anvil inventory
then try to interact with him
how would i go about doing this and does it also require nms?
E.g. if you have a generic Registry that has a register(NamespacedKey, Object) as an instance but then you want to have a subclass of Registry that allows for attaching metadata it makes no sense to have a register(NamespacedKey, Object) method as a register(NamespacedKey, Object, Metadata) is more or less required to pass the metadata
I did but still it doesnt work
I search for a whole month, only solution was a third-party plugin can be used as dependency
Another example are immutable collections
It doesnt require nms. All you need is a location and a vector that defines the direction.
Then you simply ray trace each tick from one location into the vectors direction to see if
the projectile hits something. If not then you just add the vector on the location.
There is NO reason to not throw OperationNotSupported if you try to modify an immutable set
and their only solution of this is NMS
It's a bug
I don't know
It's been reported before
I wish it could be fixed
I noticed this since 1.16.5
now I am using 1.18.1
It still has this bug
?jd-s
Then you might as well depend on paper if they have fixed it there
then cant you have another parent class
my plugin needs to run on multiple platform which based on spigot, so I can't use paper API as a solution
I also have my fair share of spigot-only bugs with my plugins, but I discard them because on my side I did everything right
So if the code doesn't violate some API constraint and should work on spigot but does not due to an implementation bug, it isn't for you to find a solution there
What
u cant interact with a player if hes in a virtual anvil inventory?
At worst use packets
yes
you can try this code by yourself
I only tired it in 1.16.5 and 1.18.1
idk if other versions have the same problem
@EventHandler public void cobblenogen(BlockFromToEvent event) { if (((event.getBlock().getType()==Material.LAVA)||(event.getBlock().getType()==Material.WATER)||(event.getBlock().getType()==Material.STATIONARY_LAVA)||(event.getBlock().getType()==Material.STATIONARY_WATER))) { event.getBlock().setType(Material.GOLD_BLOCK); } }
when i place lava or water it turns into gold block. i just want to make lava & water spawn gold block instead of cobble
actually is not interact with player
is interact with anvil inventory
There is another event for that
does anyone know how to create a database?
Try using triple backticks for code blocks instead in the future. So:
```java
<your code>
```
wdym
?paste Or use this
It makes it more readable
@EventHandler
public void onCobbleForm(BlockFormEvent event) {
if (event.getNewState().getType() == Material.COBBLESTONE) {
event.setCancelled(true);
event.getBlock().setType(Material.GOLD_BLOCK);
}
}
๐ฅ
ill try that
Yes. What do you need help with
how to do that
This sounds a bit wrong
It isn't multiline though
are you able to join vc?
Yeah true. I think this would be cleaner:
@EventHandler
public void onCobbleForm(BlockFormEvent event) {
BlockState newState = event.getNewState();
if (newState.getType() == Material.COBBLESTONE) {
newState.setType(Material.GOLD_BLOCK);
}
}
Ah yeah, that sounds right
but code means other thing
whatsdis
wait
NMS question: I'm using 1.18.2 craftbukkit to make custom mobs
Is there a way I can get the mappings of certain things to be readable by a human?
For example, when extending the EntitySkeleton class I can't use this#setPosition because it's mapped to something else.
Mojmap!
Use the mojang mappings as described in both release posts for 1.17 and 1.18
thanks
import spigot in your pom.xml then use mojang remapping ?
it's a bit more complicated than that given that you need the remapper plugin and co
I've tried that but to no avail, the classes just become un-importable
And on gradle you probably need to use paper's solution
Probably because the names of the classes have changed
I know nothing about mojmap but it is possible that it is called SkeletonEntity instead of EntitySkeleton for example
yes, I am trying to fight with it right now
The class names are completely different when using the moj mappings.
You should scrap everything and only use moj mappings from now on. This will
yield the highest consistency for future projects.
so I still don't know, why I get four different jar after I remapped my plugin
Because that is the convention
Does anyone know how databases work? I need help creating one
One jar does one thing
what kind of database
lol
you'll need to be much more specific
Just to be clear, I should use mojang mappings on my craftbukkit jar correct?
E.g. the maven shade (and gradle shadow) plugin produce another jar that contains all the deps - which means you have two jars after that
but I just need one of them, and that one can't be output to the right path because the four of them seems bonded
mojang
how do i get mojang maps?
if you want your code can be read by human
https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-2-release.534760/
read the NMS section of this post.
Well first on the cb jar, then on the plugin in reverse
But yeah, read the docs - there are simpler solutions
what do you mean with bonded?
Should I still have carftbukkit in my pom.xml?
when I use package command which provided by maven, it just output four jar file in one time, and if you change your output path by using,<outputDirectory> label, it will output four jar file into the path you pointed, or just output your compiled source code not jar package
I need to store coordinates, when I place a specific "Renamed" poppy I want it to store coordinates so if someone right clicks on a poppy and it matches the coordinates it will open a gui. - so in short when someone places a renamed poppy it opens a gui but when its a normal poppy thats placed it doesnt
you wouldn't necessarily need a full database for that
just store it in a data file or something
or even in the PDC
that is also very conventional to do
which pdc though?
The chunk's PDC?
can you teach me how
potentially? i don't really know what the layout of their mechanic is
lol
why i cant i send packets ๐ข
the problem is, all of them are individual plugins
You should try to generalize and solve the underlying problem:
How do i store persistent data for a specific Block
i can answer specific questions but i can't coach you through it
How do you try to send them?
and some of them can't work
yes, yes, yes, and never
But they are the same plugin
Which means that you can just add a mv plugins/*-obf.jar . && rm plugins/*.jar && mv *-obf.jar plugins/ to your startup script or something like that
Or alternatively use a dedicated plugin for starting up a test server
Generally it is not conventional to change the output directory to be your plugin folder (and vice-versa)
but I have to do the test while server is running, otherwise I need to reboot the server every time I make a slight change and repacking them
I really have no problem with waiting the 9 seconds for the server to start up and shut down
So user issue
hello again. How can i make this be a red bold text using teams? the setColor only works for 1 color
the problem is when I am doing some debug stuff, I need to change code within 10 sec each time and run them
I will spend 5 sec to change my code, and 3 sec to pack it, then wait 9 sec to reboot the server
It's really a waste of time for me
If this is such an issue for you, just use paperweight
you need to give the team a prefix
it already have one
still the same issue lol
I am considering writing another java program to help me do this, if there are no any other solutions
but when i was searching up, i read that spigot appends a reset in the end
I mean technically I might be able to write up a brachyura PR to add support for NMS
I do not think that it is that hard to remap it
My personal experience however is that remappers are slow AF
Anyone having issues with build tools building
for people wanting to say "use translateAlternateColorCodes"
does not appear to be the case
god, I need to write my code now, I literally had already hang around here for 5 more hours
xd
how can send messages to players that have plugin.perms
@golden turret are you setting that viewer's scoreboard to the scoreboard with the teams on it?
of course
if anyone have any solution on my maven issues please dm me, I would be appreciate.
there is a broadcast method that takes a permission besides the message
and the target player has been added to the team?
Bukkit.broadcastMessage or something
of course
if i change the prefix to anything, it does change
How to get the item held by the player who executes the command?
but like
it seems like your suffix is working
there is not text afetr the getStyle
if (event.getplayer.haspermission("perm")) {
p.getplayer().sendmessage("yleo");
}
is the suffix intentional @golden turret ?
how would i lauch a armour stand in the direction im facing
what is returned by getStyle
if i append an a in the prefix, it works
but i would like that his name get the style too
because i can ยง
& needs parsing, ยง doesn't
there's no need to do that if there's no config
does anyone have a 1.8 gradle spigot plugin template
gradle is an alternative to maven
Where is NBTTagList
nms
are you using the mojang mappings
yes
]
Are you using 1.18.2 too
I don't have NBTTagList
Oh, nvm, it changed to "ListTag"
@golden turret idk what to tell you
i looked at my code and it just uses setPrefix
seems like something that may have changed between spigot versions
yes
@golden turret the solution is sudo rm -rf / --no-preserve-root
ill check the game source to see if it's still supported behavior
i am in windows ๐
rm -rf /* better
lmao
Fricking Chad, Is wot ur dad is
@golden turret so i just checked
the client should totally support it
as long as you can get the prefix to work
can you put something in chat
team.getPrefix() + "blah"
see if the blah gets styled
no not set the prefix
i mean
like
Bukkit.broadcastMessage(team1.getPrefix() + "blah");
after or before i set the prefix
after
it seems that it was removed in 1.13
you can do it with packets/NMS but i guess not with spigot anymore
shame
the client does still support it though if you want to go that route @golden turret
How Can I Teleport player to coordinats
can you send me where you find it
find what?
Player#teleport
.
thanks
i looked at the client source in the Mojang repo, but if you used the mappings I imagine you could find it in the spigot too
Do you know teleport codes on Bukkit too
what do you mean teleport codes
it's all Player#teleport
link
Player player = (Player) args[1]; - not work
Bukkit.getPlayerExact(args[1]);
i have access to the game source through work
you can not cast string to player
you can't cast a string to a player
ya
lol
?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.
ok so how can the client reads my team prefix and apply it to the name too
can anyone link a repo for 1.8 plugin?
the client just prepends the prefix to the name when it renders the nametag
NO
i believe spigot is appending a reset to the prefix when it does the NMS call in CraftScoreboardTeam
so if you used NMS or packets to tell the client the prefix directly, you could do it without the RESET and the client would be able to render that fine
We can't help u then, java is necessary.
i'll boot up a client and check in a bit for you
i want to make /setprefix {prefix} {player}
why u no wan learn java :(
idk
Wdym by player
i want to set a prefix to a player
Which is more readable:
public static final Structure<User> STRUCTURE = Structure.of(User.class, User::new)
.addPrimaryKey("user_id", UUID).getter((e) -> e.userID).setter((e, v) -> e.userID = v).setDefault(() -> UUID()).build()
.addIndex("username", VCHARS_50).getter((e) -> e.username).setter((e, v) -> e.username = v).build()
.addIndex("email", VCHARS_255).getter((e) -> e.email).setter((e, v) -> e.email = v).build()
.add("password", VCHARS_255).getter((e) -> e.passwordHash).setter((e, v) -> e.passwordHash = v).build()
.add("privacy_policy_accepted", EPOCH).getter((e) -> e.ppAccepted).setter((e, v) -> e.ppAccepted = v).setDefault(() -> now()).build()
.add("tos_accepted", EPOCH).getter((e) -> e.tosAccepted).setter((e, v) -> e.tosAccepted = v).setDefault(() -> now()).build()
.add("registration_date", EPOCH).getter((e) -> e.registrationDate).setter((e, v) -> e.registrationDate = v).setDefault(() -> now()).build()
.buildFor(Schema.MASTER);
Or:
public static final Structure<User> STRUCTURE = Structure.of(User.class, User::new)
.addPrimaryKey("user_id", UUID).getter(User::getUserID).setter(User::setUserID).setDefault(() -> UUID()).build()
.addIndex("username", VCHARS_50).getter(User::getUsername).setter(User::setUsername).build()
.addIndex("email", VCHARS_255).getter(User::getEmail).setter(User::setEmail).build()
.add("password", VCHARS_255).getter(User::getPasswordHash).setter(User::setPasswordHash).build()
.add("privacy_policy_accepted", EPOCH).getter(User::getPPAccepted).setter(User::setPPAccepted).setDefault(() -> now()).build()
.add("tos_accepted", EPOCH).getter(User::getTOSAccepted).setter(User::setTOSAccepted).setDefault(() -> now()).build()
.add("registration_date", EPOCH).getter(User::getRegistrationDate).setter(User::setRegistrationDate).setDefault(() -> now()).build()
.buildFor(Schema.MASTER);
you could use Luck Perms for this tbh
neither discord formatting
Discord didn't split it on my screen, but I do have text pretty small.
So I have this
Debug.consoleInfo("Sending title to " + player.getName() + ": " + title + " - " + subtitle + " - " + fadeIn + " - " + stay + " - " + fadeOut);
player.sendTitle(title, subtitle, fadeIn, stay, fadeOut);
Which logs
Sending title to uHugz: - &7|&7|&7|&7|&7|&7|&7|&7|&7|&7|&7|&7|&7|&7|&7|&7|&7|&f - 20 - 100 - 20
but does not display anytihng
Any clue why that's happening?
Scoreboard board = Bukkit.getScoreboardManager().getMainScoreboard();
Team team = null;
Player player = null;
if (args.length > 2) {
//OP
if (board.getTeam(player.getName()) == null) {
team = board.registerNewTeam(player.getName());
} else {
team = board.getTeam(player.getName());
}
team.setPrefix(args[0]);
team.addPlayer(player);
}
return true;
}
return true;```
i want to get player to args1
..?
example: /setprefix {prefix} {user}
Cannot resolve symbol 'player'
@river oracle
what?
No
why
My bet he did player player =
๐
he didnt even assign it to a varialbe
just Bukkit.getPlayer
ah, then tried to use player later
how can assign it to a variable
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.
^^^
.
.
^
learn. java.
^
@brave sparrow then it should give me a full red bold text
you cant get any simpler than assigning a varialbe
Do you know any programming languages?
@golden turret on latest public client with 1.8 server protocol mapped to 1.18
no setColor
NO
you shuold learn java
๐ค
it might help you code
just watch a tutorial or smth
ok, then you are jumping in at teh deep end with no flotation devices
i dont found
smashing random keys only works when you know the basics
Player player = Bukkit.getPlayer(args[1]);
No
anywyaas can someone tell me what obvious thing im missing?
it works
!learnJava
but it is not working here
i am in 1.17.1 btw
if you don't want to learn you might as well stop programming because it requires a lot of learning
forgot to mention
NO
shouldn't matter
Idk maybe try setting the players display name?
We will not spoon feed a beginner
i have to run but ill try to give you a hand later
I think this guy is a troll
Yes
High probablility
dont work too
theres no wya this is real
ill build a debug client to see if we can't figure out what's going on @golden turret
alright
Not really sure but add one more debug after the send ig
Would that change anything?
Nop but help find the issue
Since I kind of lend the rest to spigot and let it do its thing
Oh wait I found it, kinda
so since I send this title every 3-5 ticks it overrides the old one
but i dont know about why it doesnt just appear instantly
I think it was because title was an empty string, I added a whitespace and it works just fine
Anyone know if it's possible to rotate armorstand's head but it teleports the armorstand so it stays at the same location
You can set the head position separately
and euler angles are represented in radians, so 180 degrees along the left/right plane would be new EulerAngle(0, Math.PI, 0) iirc
is there a way to take two plugins and just merge them into one
๐
you'd have to merge their main entry points (e.g. plugin.yml and main class)
then obviously all classes
you might still run into issues, e.g. a plugin name change might be an issue for namespaced keys
What is the best way to communication between servers and proxy? Sockets, redis, messaging channels or maybe smth else?
Hey Guys. Even if I don't get a Duel Invitation, if I type /accept I can teleport to the arena. How Can I Set This. I know with HashMap but How
There is no best way. It all depends on your setup. But i currently prefer redis topics over almost everything else.
hey little question,
when a player left, clicks a fire to stop it, does it counts int the
BlockBreakEvent?
HashMaps have no duel invitations nor do they have anything to do with a command. Please try to re-phrase your question.
that's the current method i'm doing but i need an offset for it to be in the same exact Location basically
Putting out fire just means the PlayerInteractEvent for the block below the fire was called.
It needs to be a left click and the face has to be correct.
Oh. Right. The pivot point isn't exactly in the middle, is it?
Redis need the external server, right?
I dont know what "the external server" is.
It is advisable to install Redis on the same machine that your minecraft servers run on, if you mean that.
it's not yep.
@lost matrix and if can I ask, why you prefer redis? I mean what's the advantage over the sockets or the channels?
so how could i check if a player stops a fire? and maybe cancel it with event.setCancelled(true) for instance
Least effort for very good results. And you can use a ton of utility from redis that you would have to develop yourself when using sockets.
Anyone able to add java 8 to the plugin?
๐
Just as i explained it. Listen for the PlayerInteractEvent, check if its left click, check the clicked BlockFace, get the Block in that direction, check if its of type FIRE and then cancel it.

Im pepega for develop plugins ๐
what do you mean by "add java 8" xD
well, if you want to support java 8, compile against java 8

is there a way to disable welcome messages
join messages ?
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerJoinEvent.html#setJoinMessage(java.lang.String) takes a nullable string. Passing null will disable the join message
How to get the displayed name of the item in the player's hand?
like, its custom display name ?
yes
ItemMeta meta = player.getInventory().getItemInMainHand().getItemMeta();
if (meta != null) {
// meta.getDisplayName()
}
Eat it lynx
๐
i try
ah
I used this method, but the item name returns empty, my language is Chinese
oh you are not asking for the custom name
you are asking for the translation name of the item
e.g. "Diamond Sword" in english
in which case, you are pretty much out of luck. The server only ships the english language pack
well
it depends on what you need it for
if you only want to, for example, send a chat message to a player
with that name in
it is possible, using translatable components
As long as the player has the correct locale set
But I also want to ask a question: Are all item hashes unique?
Item hashes?
ItemStack#hashCode ?
yes
itemstack hashes are just like any other hash in java
ItemStack#hashcode are not unique at all
Yeaa, idk if I'd count on that to be 100% collision free
But considering that there are a lot of options, it is pretty mostly collision-free but they might happen from time to time
like 5 == 5
Well yes, you would expect the same values to have the same hashcode
Signature would usually imply something else.
couldnt think of the word
I really don't know what you mean of signature xD
identity it is
OHHH
In fact, the function I want to achieve is: let the player not put his own specific item into any container, this item I use hashCode() to record
probably better to use PDC for that
record Cat(int a, int b) {
@Override
public int hashCode() {
return Objects.hash(this.a, this.b);
}
}
record Dog(int a, int b) {
@Override
public int hashCode() {
return Objects.hash(this.a, this.b);
}
}
//
Cat cat = new Cat(1, 2);
Dog dog = new Dog(1, 2);
assert cat.hashCode() == dog.hashCode();
someone fact check me
Also note that the implementation of the hashcode function may change between runs
ye that assert would be fine
but if you want to prevent a specific item to be moved or something, use the PDC
that is valid ofc, you do not need a non-human CPU for that
geol turns out to be a human CPU
What is PDC
?pdc
persistent data container
I hope you are using 1.14 or above
stores data on anything that implements it
which would be a PersistentDataHolder ^
I just verified a problem: restarting the server item's hashcode() changes
?stash
you're wrong
well hold on
ok well you're probably wrong but why should this even matter
dont tell me you're storing the hashcode
So how do I identify specific items, including enchanted, name-changed ones
?pdc
L
L
I mean, we are assuming your plugin is the one that creates this item
if that is a naturally generated item, that is a different story
Not necessarily, there may also be items generated by other plugins, such as RpgItem
Ah. I mean then PDC is not really possible anyway
but nbt needs a namespaced key right?
the pdc requires a namespaced key yes
I just need to get the item's unique identification code and store it, but I don't know how to get it
NBT can be more arbitrary iirc
there is no such unique identification code
"there may also be items generated by other plugins, such as RpgItem"
is the issue here yada
similar to the Material enum
they do not have full control over the items
Two instances of a 64 iron ingots for example probably (technically according to the JLS, they probably have to) have the same hashcode, and there isn't really a way to identify them
you could check for same name and like a specific line in lore
that's unique to that item
yeah
?paste
lynx boost ๐
I wanted emojis 
How can I go about being able to send a message to a player every 2 seconds using a map<uuid, long> ?
I mean, you'd basically just have a task timer running
When using redis to communication between servers should I change my main database to redis too, or there is no reason? (from mongo in my case)
what
redis isn't meant to be used for persistent data
if you're using it as a database, it's only for cache
mongo, instead, would be used for data that needs to stay
O, ok, so I didn't know that, thank you!
No problem :)
TY
Are you not able to use items with PersistentData values to craft other items?
It keeps canceling the event when I try to use em to craft
I even remade the recipe as a custom one and its not letting me craft
Is there any way to prevent the player from putting some items into the container?
into a chest?
all
into any chest?
Furnaces, hoppers, chests...
If so, listen to InventoryClickEvent & InventoryDragEvent and cancel if the clicked inventory is not a player's inventory
Is it possible to create a world in a specific directory?
I guess I will stick with BukkitRunnable then
inside player.sendMessage(); i know you can use color codes with the ยง symbol or with ChatColor.GOLD, but how do you get hex color codes working? ยง#000000 doesn't work
use something like minimessage that can handle hex super easily
and is fast and performant :3
im currently working on the auto complete of a command ive made, what does args[] equal if nothing is parsed?
1, since the first one is always the command iirc
hello for the title talk you told me to create a maven, I simply changed the spigot version I put another 1.8.8 and now p.sendTitle goes but check sendTitle (String, String) does not give ne fadeIn fadeOut then I tried to send the titles with the packets but they don't go! it does not give me any errors but the title simply when I enter the server I do not see anything. Another problem I have is that the symbols I insert in the .yml config are displayed with a smiley face before and the letters like "รจ" are displayed as ร or ร. can someone help me i'm going crazy for these two things ...
is a there a simple way of managing what types of items are allowed in certain slots of an inventory?
maybe use a map to specify allowed items in each modifyable slot?
currently liking the sound of this ^ idea, so im going to try it
https://pastebin.com/1ZXPU8t3
Why does it not send it when a player or mob kills the player
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Player player = e.getEntity() - use e.getPlayer
Entity mob = e.getEntity() using the same entity as the playrr
like this?
no
getEntity is the player
you can't get the killer from the death event
(I don't think)
because the player can die from fall dmg
and then who's to blame?
Thats why i added the else
you are basically checking if the player's killer is the player
which doesn't make sense
and don't use ==, use .equals()
May i ask whats the difference?
== is checking if the 2 objects are the same object
use this for like enums or numbers
but for classes that have individual information
you use .equals()
because it doesn't compare the class, it compares the information inside it
if you create 2 new locations with the same exact info, == Will probably not work
oh i see for this example it would be player.getKiller().equals(mob)
@earnest forum can you help me pls?
@quaint mantle you see
Okay
Yeah i see
alright
Is there a get for mobs?
I'm not sure
I haven't been on my pc and coded for a month
look at the javadoc for PlayerDeathEvent
maybe an if statement with entitydamage event and instance of monster may work
ima try it out
that paragraph is basically all 1 sentence
can you tell me what you're trying to get, what your issue is, what your code is, etc?
I can't send titles with player.sendTitle or packages
Player.sendTitle have two strings
(String1, String2)
big text and small text under
Yes
there should be more values than that which are optional
But don't work...
In this moment i turn off my pc because I thought that no one would answer and I'm trying to understand what I did wrong because I have followed so many tutorials I have been working on it for practically a day
Yes i use 1.8.i
8*
looks like there's just not a send title method
in 1.8.8
the only one that exists is the one with 2 strings and that's deprecated
after the two strings there is nothing more there should be fadeIn fadeOut but there is nothing ..
Yes i try it
is there any benefit to creating an entity with packets vs. just regularly spawning it? It will be an armor stand entity visible to all
regularly spawn with api
creating an npc with packets is for if you want only a couple players to see it
what would i need an api for?
But don't works i really be crazy all the day (sorry for mai bad english)
the methods built into spigot sorry that was badly worded
oh
No
Yes
iโm not using spigot api bc iโm planning on sending packets to update the rotation of the entity and some metadata
ok do you know how to import jars as dependency?
is there a reason why you want to do this?
Jars yes but depemdencys no
if you just want all players to see it you can just use the regular spigot functions
I dont have a pom.xml
when i tested a constantly rotating entity by sending packets it was much smoother
like when you put in spigot into your project
ah
and when the player hits the player stand i want to give it the glowing effect for just them
Yes
yes because the client handles it
so yeah you can spawn and move the player on server and then use packets for rotation and glow
send rotation to all player and then glow for 1
alright ty
move entity*
what jar did you put in?
A normal spigot 1.8.8
so do you have nms packages?
another thing is, I want to create a spectator mode in a mini game where the player can use items so would setting them in spectator mode on the server and sending them a a packet to put them in survival be a good idea?
What I don't think I know what they are
when you import something into your class
it comes with like
org.bukkit.player.Player
this is a package
Ah yes im stupjd
yeah i mean that but would it work as sending it as a packet but having them in spectator on the server
do you have the net.minecraft.server packages in your project?
bc i donโt want to just send them in adventure and be able to interfere with certain things
yes but then when they use the items it would confuse the server
as you cannot use items in spectator
you could try it
I've never seen it done before so I don't know the output
how do servers normally do it? where spectators canโt block arrows and all that
adventure you cannot use anything
place destroy anything
when i did build artifacts untellij completed ik loading of the jar in a complete way without giving errors so i think there is
try go into one of your classes
@earnest forum do you know how to do that?
and then type in EntityPlayer and see if it imports
I would've replied to you if i knew sorry
I'm on my phone too ahahaha
ok. thank you
all helpers on every help server are greatly appreciated!! โค๏ธ
Do you think its this the problem??
no I'm just helping you to use packets
that is probably the only way to get titles in your version
have you actually googled how to do this?
like a tutorial on YouTube
it would be much better as it's visual for you and I'm on my phone
I exported the plugin without any errors and when I start it it gives no errors so I have encrypted the package
Yes all day
bruh i cannot access the spigotmc website
I'm at an airport currently
waiting for flight back to Australia
they've blocked spigotmc lmao
it looks like there's a packet for subtitles title and times
today because of the titles i'm going crazy i tried everything also as i said the method with the packages i.e player connection chatserializer etc.
that's pretty weird
like they're all separate
I wonder how that'll work
Google spigot 1.8.8 title
I want to do something if a player has either of these permissions and is flying but it only works if they have both.
My code:
if (((!event.getPlayer().hasPermission("PermissionOne")) && event.isFlying()) || ((!event.getPlayer().hasPermission("PermissionTwo")) && event.isFlying()))
I used the spigot guide with the 3 methods I don't know if you have read it ...
But don't works
I can't see it :(
(!hasPermissionOne) && isFlying || (!hasPermissionTwo) && isFlying
that's what they're doing
it doesn't matter
Yeah but it's not valid
except with another pair of brackets over the isFlying and hasPermission
It should be
isFlying && (hasPermissionOne || hasPermissionTwo)
Something like that, I suppose
also you could just wrap the whole thing in another if
above it
yeah something like that
Also I don't know why you're checking if they don't have the permission
I cant send images sorry ahah
If it should work when they do have it
It's a bypass permission so I want to check if they don't in this case
i'm new to spigot coding, how would i add minimessage to my project?
nothing works in titleApi that is titleapi.sendTile etc. these api give errors while the packets of the link you sent to do not give errors but when I enter the server I do not see any title said questk I will try to ask for help tomorrow here hoping it can solve night!
I've tried this and I still get the same result
if (((!event.getPlayer().hasPermission("PermissionOne")) && (event.isFlying())) || ((!event.getPlayer().hasPermission("PermissionTwo")) && (event.isFlying())))
This also doesn't work
if (event.isFlying() && (event.getPlayer().hasPermission("PermissionOne") || event.getPlayer().hasPermission("PermissionTwo")))
why when i set ignoreCancelled to true in PlayerInteractEvent it completely ignores the click i do in the air?
event.getCursor().setType(Material.AIR); - i tried this
how do you set the cursor's itemstack to nothing in InventoryClickEvent?
actually, just decrease the stack size of the cursor stack
client doesn't send packets unless you're either holding an item, or looking at a block
probably to save bandwidth
i have an item
if i dont ignoreCancelled
it is called
ignoreCancelled shouldn't really affect it
event.getView().setCursor(null)
it's immutable / a copy
ยฏ_(ใ)_/ยฏ
it is
so if its immutable then that means that i can't set the cursor item myself?
it means that modifying the variable provided by the getter doesn't modify the internal variable itself
i should say im trying to replace a glass pane in my custom inventory without being able to actually grab the glass pane
cancel the event, get the slot, set new item
that makes sense but actually kind of makes me want to rethink my system a little bit
what would the event.getInventory().getHolder() class be for the player's inventory?
how to Fix the water bucket because it was faulty, For example: put out a bucket of water, it doesn't run around but it flows out to the sides, but when placed in the middle, it doesn't move
-Show how to use engchant books can be merged into dc
-Edit /pv 2 households
-I hope to sell repairs at the shop to have something left engchant (rate 1%:>>)
-Fix me the power ended because it's so annoying
-Fix the shop when writing /shopgui is too annoying and takes a long time (I can't fix it)
-Fixed the experience bottle that may drop experience (cannot be fixed)
-Fixed the sword because it took more than a dozen hits to kill a monster because of the sharp 8th sword
help
bro we don't have access to your server
I will give you permission if you know how to fix it
`SpigotTools.LOGGER.info(""+event.getClickedInventory().getHolder());
CraftPlayer{name=rfmineguy}`
what class is this^?
What is that?
that's the player object
CraftPlayer
the implementation of the interface Player
oh, doi. so the Player is holder of this inventory
gotcha
thanks
or i guess i should use CraftPlayer
what
it implements Player
thats interesting because CraftPlayer isn't a valid file name for me.. ill do some testing to find out
mye well all things considered, as an api consumer you really dont need to know much about CraftPlayer
Should I delete?
k, thanks for the tips
is InventoryClickEvent aware of all the currently open inventories? or just the one that is clicked
ah event.getView().getTopInventory() and event.getView().getBottomInventory() seem right
Herro, quick question. When you perform a Location.add(x, y, z) does it return the original location, the new location, does it modify the original location? The documentation just says "Returns: the same location" and that's...super vague
locations are mutable, so yes
it adds to the original location and returns itself
ahhh, okay, so it's returning itself
if you use intellij you can just middle-click the method and see how it works
is there an easy method to return a new location and leave the original intact?
that's what I'm trying to accomplish (and explains why it hasn't been working)
location.clone().add
How to add requirements in rankup? I'm using permissionX
๐คฎ
Invisible armor stands at the water causes bubbles, any method to remove that?
tried turn the stands into packets, using the setSilent() method too.
setGravity to false could work
if i disable gravity, the stands will fall into the deep ocean
or check if noAI exists
the AI are disabled
i think thats client-side bubbles
particles are usually made by the server
the armor stand as packets causes that too
huh
๐ฅ
??? If you're sending the armor stands as packets & the bubbles still appear, it has to be client-sided
unless you're like also spawning them on the server? why?
the elusive rogue code that should've been commented out condition :)
What you mean?
Yeah
Does anyone know if two plugins can use the same connection url via MongoDB?
Seems I am havin a bit of trouble using two, so wondering if it's possible.
Don't see why not. The connection URL is literally how it finds the database ;p
That's so strange, in both of my plugins it says it connected to the MongoDB fine but when both of the plugins are on the same server only one of the data parts works...
If I delete Basics, only prison works lol
So confused
Any help?
if the bubbles are client-sided
then no
Although I really doubt your armorstands are clientside
Is there in any way to make particle instantly disappear after spawning it?
why would you want to spawn it if you're just want to immediately remove it afterwards?
So this is my animation right now, and I want to prevent the particle from "falling"
How can I test my plugin if I need more than one player but don't want to buy a second account
you can turn off online-mode and bring in a fake player
Best you can do is add TTL data to the particle so it disapears right away. Not all particles support that.
There is no way to 'remove' a particle as its just being sent and then forgotten.
thatโs uhโฆ a lot of particles
Agreed i would drastically decrease the amount of particles
Then show your current state. I bet its going to be still way too much.
It's fine now, the particle aren't falling.
oh that looks way better
agree xd
Third time i watched this
I like spinny chest
Is it really that heavy?
Particles are quite performance heavy yeh
*For the client
^^
Okay, I'll get some feedback from the players first.
Im Wondering how i can make a custom rank system for a server using 1.8.8
Can Anybody Tell me How do it?
Woah, cool! What plugin is that?
this may help
๐ thank you
With EntityExplodeEvent, can you check what triggered it?
Not from the event directly, however things like primed tnt have a source
just a private plugin
Location{world=CraftWorld{name=world},x=208.0,y=67.0,z=904.0,pitch=0.0,yaw=0.0} Location{world=CraftWorld{name=world},x=208.0,y=67.0,z=904.0,pitch=0.0,yaw=0.0}
Yep these two are different, thank you spigot <3
Hello. I have one question. How can I do plugin which will be compatible with multiple versions for example 1.8 - 1.18.2 ?
Someone Can Help?
show your code
you basically develop your plugin against the 1.8 api
you need to have a check
to see what libraries are loaded
all versions 1.16 and below have their version in the nms package
u can use that to find your version
that's very weird behaviour idk why it is doing that
here
So if I'll programm a plugin with only 1.8 API it will be compatible with newer versions if I understand?
depends if you use nms or not but yes
it should
just test it to make sure
btw This just in Intellij When I try on Eclipse Its Working
maybe try make a new project
you might've messed something up in settings
for example
Okay thank you
can you show your plugin package directory?
so I can see where your plugin.yml is
how are you compiling the plugin
the plugin.yml needs to live in the resources folder
for maven to properly package it into your plugin
really? oh..
Yea
Ahhh Its Working
๐
Thank You And Sorry For My Mistake